I am trying to set up SQL file Library.mdb, starting on page 162 of the VC Tutorial and get error: Data source name not found and no default driver specified - SQL Error = IM002 -0000019703 when trying to run a sample program (SimpleAccess.cbl). I am going against C:\cobolclass\datafiles\library.mdb in C:\COBOLClass\Projects\15_01_SQLProject when I try to set it up following the directions in the tutorial it seems like the instructions are from a previous version of tools. How cani setup the DB so it is recognized by the program? I got an mdb viewer and the file looks fine
This format is fine.
I see in the trace file that it is finding a DSN name of "Library " where there is a space after "Library". I am not sure if this is causing the problem or not.
Can you please create a new DSN again using the same Library.mdb file but use a completely different name like "Libconn" and then change the CONNECT in the program to use "Libconn as well?
This solution worked! I am now getting output from the program. Thanks for your help,I appreciate it. Another one solved - John
I just tested this here and it worked fine for me and the connect returned sqlcode=0.
Did you use the ODBC Administrator 32-bit to create your DSN?
All I did was start the ODBC Administrator 32-bit:
Go to System DSN tab
Select the Microsoft Access Driver (*.mdb) driver
Specify name as Library
click Select button and navigate to C:\COBOLClass\DataFiles and select Library.mdb
That was it.
I followed the instructions above and it appears to have worked. However, when I run the SimpleAccess.cbl pgm again I get error SQL Error = IM001 -0000019703
Could not make connection.
Open up the OpenESQL Assistant from under either the Tools-->Micro Focus menu or the View-->Micro Focus SQL tools menu, depending on the VC version you are using. Does your Library DSN show up in the list of available DSNs? If you click it can you see the two tables defined?
Only the name Library shows up not Library.mdb. When I click on it it goes to the select data source screen and Library shows up there, too,with a description of Patron/ Book DB that I think is correct. But they are not defined. When I use MDB viewer it shows both Patron and Book as separate entities, though.
The DSN name is Library so that is what should show up in the list. Library.mdb is the database file that it should point to. If it is prompting for a data source then the Library.mdb file is not set correctly. When it prompts for the data source can you browse to Library.mdb and select it?
Using the openesql asst I now show book and patron underneath Library, but when I do a query on book and go to results tab it doesn't come out with anything. I don't see a submit button.
Sorry I found the run query button and it comes back with requested fields. However, when I try to run the program simpleaccessagain it comes back with cannot make connection.
From the OpenESQL Assistant with the query open please use the Auxiliary Code tab select Connect statement and copy and paste this into your program as a replacement of the connect statement that is already there. Do you still get the error?
I still get the same error, but i noticed something,the connect sql statement has the connect word in green and the to word is in blue as are other sql statement words, perform, exec sql, cursor,etc. Also, in the statement EXEC SQL INCLUDE SQLCA END-EXEC.include is in green exec sql is in blue. Can it be that these words are not being recognized?
What is the actual error message that is returned in the MFSQLMESSAGETEXT variable after the connect?
The coloring you describe is correct. COBOL reserved words are displayed in blue and non-reserved words like CONNECT are displayed in green.
If the words were not recognized you would get a compiler error and not a run-time error like you are experiencing.
Are you using Visual COBOL PE V2.3?