Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with ODBC connection
Message
 
 
To
05/05/2004 09:59:17
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Germany
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00901172
Message ID:
00901175
Views:
24
Hi Albert,

If your form isn't modal than =sqldisconnect(0) will fire immidiately after form is instantiated making connection handle invalid.

>
>I have a programm that connects me to a database and than starts a form
>public p_connection
>p_connection = -1
>STORE SQLSTRINGCONNECT('dsn=maxdblokal;uid=xxx;pwd=xxx;DATABASE=xxx') to p_connection
>if p_connection > 0
>	messagebox(str(p_connection))       = 1    !!!
>	do form xyz
>	=sqldisconnect(0)
>endif
>When calling
>l_sqlcmd = "select * from tablename"
>l_error = SQLEXEC(p_connection,l_sqlcmd,"alldata")
>browse
>in the init event of the form xyz everything is ok !
>
>but when calling the same at the click event of a command button in the form i get a error
>connection handle not valid ????????????????????????
>the debugger show me, that p_connection = 1 ??????????????
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform