Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing remote ODBC Connection 1

Status
Not open for further replies.

Halliarse

IS-IT--Management
Jan 8, 2007
213
GB
Hi

Visual basic 2003
ODBC to MySQL 5.1

I have created a VB2003 application that I want to run on client machines. I have created a share on the remote machine and a shortcut which runs the executable from a share. After amending the security Policy within the .Net Configuration I now have the executable running, however, I am having an issue withe the ODBC connection.

When I run the executable, I get the error 'Data Source name not found and no default driver specified.

I am assuming that this is because it is trying to connect t the database locally as opposed to remotely, which is what I want to do!

Can anyone advise if this is actually possibly and if so, how?

Thanks

Steve H
 

Unfortunately, you cannot use an ODBC DSN that is located on a remote maching. You need to register the DSN on the local machine for it to be available to your program.

Fortunately, this is not hard to do.

The easiest way I know, that requires the least programming is to use a File DSN. On your development machine, create the DSN as a File DSN, and note the location where the file is saved. You can now just copy/paste that file to another machine. Alternatively, the DSN file is a simple text file with a .dsn extension, so you could write some code to check if the DSN file exists, and create it if not found.

Other methods of creating a DSN involve writing to the registry and such. If you are interested, you can do a Google search for "vb .net create system dsn" (without quotes) and you should get tons of info.


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top