Jump to content

DB Connectivity Tools - ODBCCP32.DLL


Recommended Posts

Hi.

I'm working with the DB Connectivity Tools. I want to do exe-file from my VI, and I've got problem. I need add database file (MS Access file) to ODBC system source in LabView, and if it's possible create datalink in LV (without using Tools->Create Datalink). Somebody advices me to use the odbccp32.dll and the SQLConfigDataSource function, but it doesn't work. I put my VI in the attachment. Maybe somebody helps me ?

Link to comment

I normally use a udl-file.

(create a empty text file and rename it to something.udl , and then double click on it)

My software reads this UDL/Text file and grabs the Provider string from it.

E.g.

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Production;Data Source=MYSERVER

The file is unicode and so you have to strip off all NULL-characters.

If the file don't exists I start by creating it by just writing this Unicode-text file.

Cheers,

Mikael

Link to comment
  • 2 weeks later...

QUOTE (CzaroK @ Feb 24 2009, 11:10 AM)

Hi.

I'm working with the DB Connectivity Tools. I want to do exe-file from my VI, and I've got problem. I need add database file (MS Access file) to ODBC system source in LabView, and if it's possible create datalink in LV (without using Tools->Create Datalink). Somebody advices me to use the odbccp32.dll and the SQLConfigDataSource function, but it doesn't work. I put my VI in the attachment. Maybe somebody helps me ?

There are a few caveats with this for sure. First you can not add a System ODBC Data Source if you do not have administrator or at least power user rights. So I doubt this is what you want to do in a built executable.

Also you can simply format the parameters that would otherwise be created with the ODBC Data Source Manager dialog into a string and pass that string to the Open Database function as connection string, instead of a name to an ODBC data source. To see what you would need to put in a string you can basically configure on your development machine such a datasource through the ODBC manager and then fgo into the registry and look at the keys in the section for your data source in HKEY_CURRENT_USER\Software\ODBC\ODBC.INI for user data sources and HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI for system data sources.

You basically just put each value in there in a format <keyname>=<keyvalue> and separate each such expression with a semicolon and you should be fine. No need to create a Data Source and you can even format the actual path to your .mdb file no matter where you have it installed.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.