vb6 sql to access

Reply

Join Date: Mar 2008
Posts: 1
Reputation: Ross Cox is an unknown quantity at this point 
Solved Threads: 0
Ross Cox Ross Cox is offline Offline
Newbie Poster

vb6 sql to access

 
0
  #1
Mar 17th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,093
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 126
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: vb6 sql to access

 
0
  #2
Mar 18th, 2008
You need to enclose the quotes by enclosing quotes since it is a string.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 122
Reputation: cometburn is an unknown quantity at this point 
Solved Threads: 19
cometburn's Avatar
cometburn cometburn is offline Offline
Junior Poster

Re: vb6 sql to access

 
0
  #3
Mar 18th, 2008
  1. 'this is your string
  2. "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"'
  1. 'correction
  2. "Select ID, Make, Model, PlsPerBBL, Size, Processor, Location From MeterData Where MeterNo = 'FQ-805 8 IN'"
Last edited by cometburn; Mar 18th, 2008 at 4:17 am.
Proud to be Philippine made...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC