ionutp


Hello to all,

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




Re: ODBC data source

Zografski


Take a look at http://connectionstrings.com/

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

sqlhandler = SQLSTRINGCONNECT(connsql)

IF sqlhandler < 1

MESSAGEBOX('No connection')

ENDIF







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:

http://fox.wikis.com/wc.dll Wiki~VFPCommandSQLStringConnect






Re: ODBC data source

ionutp

Thanks i've got the idea.