Discussion Locked

TO create Data Source Name(DSN)

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
i am using visual basic as frontbank & oracle as backhand, but when i install the application at the client place i also have to create the DSN in the ODBC there, so how to create a ODBC DSN in the client machine throught a Visual Basic program or throught the setup program of the application

7 replies

by snowman_mtu

You have two ways for resolving this problem.
1.Use ODBC Api for create DSN. In this case you can search any documentation for this API.
2.Use ADO technology for connect to database through ODBC driver without any DSN. I give you a working sample from my program:

Set mRsDclDdGtd = New ADOR.Recordset
mRsDclDdGtd.Open "SELECT DISTINCT NTRANS, G531 FROM DCLDDGTD", "Provider=MSDASQL;Driver={Microsoft dBase Driver (*.dbf)};DSN='';DefaultDir=" & frmSelectFolder.Dir1.Path, adOpenStatic, adLockReadOnly

This sample for dBase files. For Oracle you must change provider and driver names and check this code for any required parameters.
In this case:
1.Your program must use ADO technology.
2.Client mashine must have registered Oracle ODBC driver.
3.Your program must know its name.

Good luck :-).

by bigheart

I want to use ODBC only, i myself know about OLEDB and ADO technology, I am talking about while Deployment of a Application on the Clients Machine, and i have used ODBC to connect to the backhand.

But i will try the code given by you

by rsv

HI,
You use ODBC FILE DSN for connecting to the Database, and add that dsn file in the Package and Deployment when u making the project into setup program, then u no need to do anything on the client system, just install the setup program.

Hope this helps you.
GOOD LUCK...:)

This discussion is closed to new replies.