Mortgages | Credit Cards | Mortgages | Inmobiliarias Denia | Vegas Hotel
VB - linking ODBC database [Archive] - PCMech Forums

PDA

View Full Version : VB - linking ODBC database


dallandra
07-10-2000, 10:58 PM
Hi all,

Just trying to create a simple prog. via the data-form-wizard supplied with VB6 enterprise Ed.
My problem is this: I'm trying to link a database (the database file is in MS Excel format - and not MS ACCESS hence the link is established with OBDC) via an ADOBC data control icon to a Data Grid object.
The problem is that after filling in the required fields, and running the program, i find that a msg box error pops up with the msg (along the lines of...) 'record source name not found'.
I'm using the following SQL statement to retrieve the d/b: Select * from filename

where filename is the name of the file, and also the name of the "sheet" in MS EXCEL

any ideas anyone??

thanks in advance!

Mcubed
07-11-2000, 01:29 AM
I apologize for sounding trite, but have you checked to insure that you've placed a correct directory reference in the SQL statement? As you probably know, the slightest typo can do you in there.

Another thing, if the Excel sheet has several pages, you may have to specify which page. I don't know for sure about that one, but I've run into it when grabbing data from Excel from inside Word and other office programs.

Hope this helps

MMM

------------------
Patience is the price you pay when you can't pay the price.

[This message has been edited by Mcubed (edited 07-11-2000).]

[This message has been edited by Mcubed (edited 07-11-2000).]

dallandra
07-11-2000, 01:41 AM
Well supposidly i cant enter the directory path within the SQL statement field, as the dir-link has been established within one of the other fields (cant remember off hand) but the path was correct and using the "test connection" button whilst in design mode - VB found the file and connection was "successful"

*shrug*

anyhow thanks

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mcubed:
I apologize for sounding trite, but have you checked to insure that you've placed a correct directory reference in the SQL statement? As you probably know, the slightest typo can do you in there.

Another thing, if the Excel sheet has several pages, you may have to specify which page. I don't know for sure about that one, but I've run into it when grabbing data from Excel from inside Word and other office programs.

Hope this helps

MMM

<HR></BLOCKQUOTE>

leethehund
07-11-2000, 01:04 PM
Don't know if this will help as I use VB5, not 6, but I found that I had to append a "$" to an Excel file name to get a valid "table" name (same as sheet name, I think) for a Data Access Object which I beleve is the forerunner of the OBDC.
lee