Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a SQL Server File DSN from within VFP
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00764428
Message ID:
00764494
Views:
25
You should use SqlStringconnect.
hconn = SqlStringconnect([filedsn=c:\temp\sqlfiledsn.dsn;UID=myid;PWD=mypass' )
Also, AERROR() will give detailed info about ODBC error.

>In a nutshell, I was attempting the following (using some of your sample as aid):
>PUBLIC dsn, hconn
>dsn = 'c:\temp\sqlfiledsn.dsn'  -  This is the File DSN I created
>
>hconn = SQLCONNECT(dsn)
>
>IF hconn <= 0
>  = MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')
>ELSE
>  = MESSAGEBOX('Connection made', 48, 'SQL Connect Message)
>  = SQLDISCONNECT(gnConnHandle)
>ENDIF
>Using this code, I can never connect. I know the File DSN I created is valid, but it's actually referencing it which is giving me a hard time. I wouldn't think this would be so tough, arrggghhh !!
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform