By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,471 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,471 IT Pros & Developers. It's quick & easy.

Help Req In Insert Query

P: 2
i hve written the followin query in VBS

isql = "insert into googleQuery(filename,CompanyID,QueryText) values (" & fname & "," & rs.Fields(0) & ",""" & rs.Fields(3) & """" & ")"

while executing it shows invalid brackinting
data type for the first field is Text
data type for the sect field is Numner
data type for the fThidfield is Text


if i execute this query in VB it works fi please help

please do mention the the same query in Hytertext iels
Oct 11 '07 #1
Share this Question
Share on Google+
1 Reply


nico5038
Expert 2.5K+
P: 3,072
Try:

isql = "insert into googleQuery (filename, CompanyID ,QueryText) values ('" & fname & "'," & rs.Fields(0) & ",'" & rs.Fields(3) & "')"

When the textfields can hold single quotes you need to use:

isql = "insert into googleQuery (filename, CompanyID ,QueryText) values (" & chr(34) & fname & chr(34) & "," & rs.Fields(0) & "," & chr(34) & rs.Fields(3) & chr(34) & ")"

Nic;o)
Oct 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.