Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query not working 1

Status
Not open for further replies.

SiJohn101

Technical User
Joined
Nov 13, 2001
Messages
13
Location
GB
I keep getting this error message

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/tpv/test3.asp, line 11

strSQL1 = "SELECT * FROM tblPRICEBANDS, tblCOTTAGES WHERE tblPRICEBANDS.fldPRICEBAND = tblCOTTAGES.fldPRICEBAND AND tblPRICEBANDS.fldPRICEBAND = " & strPRICEBAND AND tblCOTTAGES.fldPROP_NO = " & strPROP_NO

However if i put anything on the end it just brings up more error messages what is the best way to the end the query????
 
Try this:

strSQL1 = "SELECT * FROM tblPRICEBANDS, tblCOTTAGES WHERE tblPRICEBANDS.fldPRICEBAND = tblCOTTAGES.fldPRICEBAND AND tblPRICEBANDS.fldPRICEBAND = '" & strPRICEBAND & "' AND tblCOTTAGES.fldPROP_NO = ' " & strPROP_NO &" '

OR

strSQL1 = "SELECT * FROM tblPRICEBANDS, tblCOTTAGES WHERE tblPRICEBANDS.fldPRICEBAND = tblCOTTAGES.fldPRICEBAND AND tblPRICEBANDS.fldPRICEBAND = '" & strPRICEBAND & "' AND tblCOTTAGES.fldPROP_NO = " & strPROP_NO

-VJ

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top