Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an ODBC via VFP.
Message
From
03/04/2006 10:52:13
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01109907
Message ID:
01109958
Views:
23
>mmm I set all the parameters... but it doesn't work.. I changed the values:
>
>
>  strAttributes = "SERVER=METAFRAME" + Chr(0)
>  strAttributes = strAttributes + "DESCRIPTION=Temp DSN " + Chr(0)
>  strAttributes = strAttributes + "DSN=DSN_TEMP " + Chr(0)
>  strAttributes = strAttributes + "DATABASE=excepciones " + Chr(0)
>  strAttributes = strAttributes + "UID=" + Chr(0)
>  strAttributes = strAttributes + "PWD=" + Chr(0)
>  intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, strDriver, strAttributes)
>
>
>But IntRet returns 0 (zero)
>
>Any further help???


I see Borislav and Vladimir aleady answered. Your sample code was not using DSNless connections with SQLSTRINGCONNECT() as I advised.
Another (unrelated) issue I see in one of the later examples on this thread is the use of user 'sa' which is the Admin. This is a bad idea. System Admin account should only be used for system administration tasks, not for everyday queries and other database daily operations. That is a security risk. Make your programs aleways use a normal user (restricted account) instead of 'sa'.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform