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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expected end of statement???

Status
Not open for further replies.

pilg

Programmer
Feb 16, 2001
82
GB
SQL = "UPDATE externalcompany"
SQL = SQL & " SET CompanyName = '" & companyname & "', addresslineone= '" & addresslineone & "', Addesslinetwo= '" & addresslinetwo & "', citytown= '" & citytown & "', postcode= '" & postcode & "', LoB= '" & LoB & "', Business = '" & Business & "', Date1= '" & date1 & "'"
SQL = SQL & &quot; WHERE CompanyID = &quot; & ID, &quot;DSN=contacts;UID=sa;Password=&quot;,3,2 <b>< <b>expected here</b>

I can't see what the problem is, HELP!
 
maybe
SQL = SQL & &quot; WHERE CompanyID=&quot; & ID & &quot;, DSN=contacts;UID=sa;Password=&quot; & &quot;,3,2&quot;

ick that looks terrible but the write to the screen to test the format looks good ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
Ok, here is your problem. you are trying to assign a value to a string variable:
Code:
SQL = SQL & &quot; WHERE CompanyID = &quot; & ID
Code:
, &quot;DSN=contacts;UID=sa;Password=&quot;,3,2 <b>< <b>

Everything in red is your error. You need to call a connection.Open in order to use this string and the connection string and other options above.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
No more vacation for me :(

FAQ FAQ20-2863
= new Forums.Posting.General.GettingAnswers()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top