0

I have the following sql statement in VB6 (latest VB SP, Win XP, SP2) that works fine in ado to sql server 2k5 but does not work in ado to access 2k3. "Select ID, Make, Model, PlsPerBBL, Size, Processor, Location, From MeterData Where MeterNo = 'FQ-805 8" IN'". I know it has a double quote for inches in the MeterNo string, but running the query directly in access works fine. This sql is querying 2 different tables. The one in SQL Server has the ID field as an identity primary key that is seeded with a 1 and incremented by 1 each record, integer data type. The other table is in Access and the ID field is a primary key but is not an auto number data type, it is a long integer. The reason for this is that the Access database contains the same data as the SQL Server database but must be used when the laptop is disconnected from the network where the SQL Server DB is located then added/changed data is uploaded when reconnected to the network. In order to control the SQL Server identity primary key and copy the data to the access database, I could not use an auto number field for the primary key in the Access table.

Help please! rcox@eprod.com

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by cometburn
0
'this is your string
"Select ID, Make, Model, PlsPerBBL, Size, Processor, Location, From MeterData Where MeterNo = 'FQ-805 8" IN'"

Location has a comma plus correct MeterNo value to '"FQ-805 8 IN"'

'correction 
"Select ID, Make, Model, PlsPerBBL, Size, Processor, Location From MeterData Where MeterNo = 'FQ-805 8 IN'"
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.