I'm making some database functions using CVI SQL toolkit 2.3 (on Windows 7 & LW/CVI 2013)
The sample files (weather, flowchart......) are all working.
I tried to create my own mdb file, but the table and data are directed to samples.mdb of the sample files.
I specified the path in DBCreateTableFromMap, but not successful.
Solved! Go to Solution.
Hey Hong Kong,
A couple of questions and points:
We just want to make a custom database file. All functions are working (DBConnect, DBBeginMap, DBMapColumnToxxxx, DBCreateTableFromMap......).
The only questions is, the data is automatically saved to sample.mdb (the sample file of CVI SQL toolkit under the folder C:\......\CVI\Samples\sql), instead of our target file.
May be there are some settings in Windows ODBC but we have no idea.
Thanks for providing that context. The first step is to register your database. I copy and pasted the default 'samples.mdb' file into another location and renamed it:
Now, we have to register the database in the Microsoft ODBC manager. For this, in my Windows search I searched for 'ODBC Data Source Administrator' and opened 'ODBC Data Sources (32-bit)'. I then navigate to the 'System DSN' tab.
Here, we have our registered Data Source Names (DSN). The 'CVI SQL Samples' should look familiar because that's what CVI has been calling. To register our database, click on 'Add' and select the 'Microsoft Access Driver (*.mdb)' option:
Click 'Finish', and enter a Name and Description as shown below. The Name is how you will reference this DB in CVI and any other code.
Click 'Create' and enter a name for your custom .mdb file.
Click 'OK' and now you should see your database appear under the 'System Data Sources':
Now just connect to it from your code by replacing "CVI SQL Samples" with "Custom DB":
In your code specifically, you can replace the DB name in line 26 where you use CopyString().
Hope this helps,
Got it! Thank you so much.
A note for other users:
In Windows 7, the Administrative Tools shows only the 64-bit ODBC. The 32-bit ODBC is located here: