Hello to all,

How can i create(by code) an ODBC data source

Re: ODBC data source


Take a look at

connsql=[Driver=SQL Server;Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword]

sqlhandler = SQLSTRINGCONNECT(connsql)

IF sqlhandler < 1

MESSAGEBOX('No connection')


Re: ODBC data source

Alex Feldstein

First you need to have the conenction string for your back end database. You can find examples online in places like Zografski already told you.

Then you need to have either a DSN (which we try to avoid) or better do it programmatically (what we call DSNLess Connections).

In VFP you do it with SQLSTRINGCONNECT()

See many examples at the Fox Wiki: Wiki~VFPCommandSQLStringConnect

Re: ODBC data source


Thanks i've got the idea.