Skip to Content.
Sympa Menu

freetds - Re: [freetds] Warning: odbc_exec() [function.odbc-exec]: SQL error: [unixODBC][FreeTDS][SQL Server]Invalid cursor state, SQL state 24000 in SQLExecDirect in

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ran September <ran.september AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Warning: odbc_exec() [function.odbc-exec]: SQL error: [unixODBC][FreeTDS][SQL Server]Invalid cursor state, SQL state 24000 in SQLExecDirect in
  • Date: Wed, 18 Feb 2009 19:30:08 -0800

ok thx jkl, i appreciate your help... i will try to become a "better
programmer" :-D although i didn't get the "outer join to mpc_web_users" part
(sorry for being silly.)
but is it true that installing the mssql.so will solve this?

Thanks.

On Wed, Feb 18, 2009 at 7:19 PM, James K. Lowden <jklowden AT freetds.org>wrote:

> Ran September wrote:
> > $conn=odbc_connect($db_host,$db_user,$db_pass);
> > $sql="SELECT * FROM gages where company = '$custid' and gage_sn =
> > '$sn'"; $rs=odbc_exec($conn,$sql);
> ...
> > $sql1="SELECT * FROM mpc_web_users where user_name = '$userid'";
> > $rs1=odbc_exec($conn,$sql1);
> ...
> > on line 64 odbc_exec() didn't work and that's when the error occurred.
> > i have many scripts like that, some worked and some aren't i really
> > need a one time solution rather than re-programming my scripts.
>
> http://www.freetds.org/faq.html#pending
>
> This is what the FAQ means by "For one thing, they become better
> programmers".
>
> If your first query had an outer join to mpc_web_users, the second query
> would be unnecessary. Your script would be simpler and run faster because
> it would make only one call to the server.
>
> Alternatively (but worse) the second query could use a separate
> connection.
>
> Both solutions work with all SQL database systems. The script as written
> does not.
>
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>



--
R




Archive powered by MHonArc 2.6.24.

Top of Page