Question : Update SQL issues in ASP and MySQL

Hey guys and gals,
I am trying to update a record in an MySQL db and I am having issues.  I have attached a screen shot of the field types (access frontend).

I am pulling the info from a form, I have included the <%=request.form%> information as well.

I am able to update the 'invoiceName' and 'invoiceStreet1' only.....

Here is the <%=request.form%> info:
cusBillingName=Chris+DaMan&cusBillingCompany=&cusBillingAddress=1234+w.+5th&cusBillingCity=Mesa&cusBillingState=AZ

When I display my SQL command, this is what I get:
UPDATE cartID set invoiceName ='Chris DaMan', invoiceStreet1 ='1234 w. 5th', invoiceCity ='', invoiceState = '' WHERE ID= 462790171


 
 
Access frontend - MySQL
323653
 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
cusBillingName = request.Form("cusBillingName")
cusBillingCompany = request.Form("cusBillingCompany")
cusBillingAddress = request.Form("cusBillingAddress")
cusBillingCity = request.Form("cusBillingCity")
cusBillingZip = request.Form("cusBillingZip")
cusBillingPhone = request.Form("cusBillingPhone")
cusBillingEmail = request.Form("cusBillingEmail")

'open a connection to the database so we can update the table...
	set conn = server.createobject("adodb.connection")
	DSNtemp="Driver={MySQL ODBC 3.51 Driver};"
	DSNtemp=dsntemp & "SERVER=YOURSERVER;Database=ILOVE;Uid=HOMEMADE;Pwd=APPLEPIE"
	conn.Open DSNtemp
	
	'update string
	dim updateCustomerInfo
	updateCustomerInfo = "UPDATE cartID set invoiceName ='" & cusBillingName & "', invoiceStreet1 ='" & cusBillingAddress & "', invoiceCity ='" & cusBillingCity & "', invoiceState = '" & cusBillingState & "' WHERE ID= " & Session.SessionID
	conn.Execute(updateCustomerInfo)

Answer : Update SQL issues in ASP and MySQL

You left out the state.  cusBillingState = request.Form("cusBillingState")
Don't see anything wrong with the city.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
cusBillingName = request.Form("cusBillingName")
cusBillingCompany = request.Form("cusBillingCompany")
cusBillingAddress = request.Form("cusBillingAddress")
cusBillingCity = request.Form("cusBillingCity")
cusBillingState = request.Form("cusBillingState")
cusBillingZip = request.Form("cusBillingZip")
cusBillingPhone = request.Form("cusBillingPhone")
cusBillingEmail = request.Form("cusBillingEmail")

'open a connection to the database so we can update the table...
	set conn = server.createobject("adodb.connection")
	DSNtemp="Driver={MySQL ODBC 3.51 Driver};"
	DSNtemp=dsntemp & "SERVER=YOURSERVER;Database=ILOVE;Uid=HOMEMADE;Pwd=APPLEPIE"
	conn.Open DSNtemp
	
	'update string
	dim updateCustomerInfo
	updateCustomerInfo = "UPDATE cartID set invoiceName ='" & cusBillingName & "', invoiceStreet1 ='" & cusBillingAddress & "', invoiceCity ='" & cusBillingCity & "', invoiceState = '" & cusBillingState & "' WHERE ID= " & Session.SessionID
	conn.Execute(updateCustomerInfo)
Random Solutions  
 
programming4us programming4us