If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Querying non-linked table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-29-04, 20:56
sjbrown sjbrown is offline
Registered User
 
Join Date: Nov 2004
Posts: 25
Querying non-linked table

I am trying to connect to a MYOB (.DAT) table using the ODBC driver. I do not want to link the table to the main database I would simply like to query it.
What I have done so far is to create a query with the 'Source Connect Str' set to "ODBC;DSN=MYOB;;TABLE=MYOB.Items", and added the table and field I want to query. The SQL created is this:

SELECT MYOB.Items.ItemName
FROM MYOB.Items IN '' [ODBC;DSN=MYOB;;TABLE=MYOB.Items];

Running this query, will ask for the parameter MYOB.Items.ItemName what ever I enter will be displayed for the number of records that are in the table. The amount of records its displaying is the same as there is supposed to be but the data is not the same. If anyone has any ideas I would be much appreciative.
Reply With Quote
  #2 (permalink)  
Old 11-30-04, 10:44
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
I dont even know what MYOB is but suspect the sql is malformed, cant be defintive because its so long since I've had the need to extract from an ODBC connection

SELECT MYOB.Items.ItemName
FROM MYOB.Items IN '' [ODBC;DSN=MYOB;;TABLE=MYOB.Items];

possibly should read

SELECT ItemName
FROM Items IN '' [ODBC;DSN=MYOB;;TABLE=MYOB.Items];
OR
SELECT Items.ItemName
FROM Items IN '' [ODBC;DSN=MYOB;;TABLE=MYOB.Items];
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On