Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically create SQL DSN
Message
From
20/06/2002 13:22:22
 
 
To
20/06/2002 11:31:58
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00670662
Message ID:
00670722
Views:
12
>I am trying to programmatically create a System DSN for a SQL database.
>I need the Login Id to be sa, no password.


Any particular reason why you need to programatically create a DSN? Why not use a DSN-Less connection instead?

Look at the function SQLSTRINGCONNECT([cConnectString]) in the help file.
nConn = SQLStringConnect('DRIVER=sql server;SERVER=(local);UID=sa;PWD=;DATABASE=northwind')
sqlexec(nConn, 'select * from customer', 'curCustomer')
Also, it is a bad idea to have an sa account with no password (as in the example above). Huge security hole. Not to mention a big exploit by the bad guys if the SQL Server DB is connected to the Internet.

See:
http://www.microsoft.com/security/security_bulletins/ms02020_sql.asp


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
Next
Reply
Map
View

Click here to load this message in the networking platform