|
| |
|
|
bdelahunty
Posts: 38 Joined: 10/15/2004 Status: offline
|
Inserting Session vars has me stumped - 5/29/2009 13:11:07
I just can't figure out what I missed in this. The insert is going to MSAccess DB, all fields are integer. Error is datatype mismatch. Appreciate any help... <% Function ParseBody(strText) End Function Dim myConnString Dim myConnection Dim mySQL myConnString = Application("fedex_ConnectionString") Set myConnection = Server.CreateObject("ADODB.Connection") myConnection.Open myConnString mySQL= "INSERT INTO veh_parts " mySQL= mySQL & "(veh_id,part_name_id,part_num_id) " mySQL= mySQL & "VALUES ('" & Session("veh_id") & "','" mySQL= mySQL & Session("part_name_id") & "','" mySQL= mySQL & Session("part_num_id") & "')" myConnection.Execute mySQL myConnection.Close Set myConnection = Nothing %>
|
|
|
|
ou812
Posts: 1703 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: Inserting Session vars has me stumped - 5/29/2009 14:59:20
I would first insure they're integers by displaying them prior to the query, just to double check. After that, you could try casting them with cint or clng if they're longer etc. ex: MySQL= mySQL & "VALUES ('" & clng(Session("veh_id")) & "','" mySQL= mySQL & clng(Session("part_name_id")) & "','" mySQL= mySQL & clng(Session("part_num_id")) & "')"
_____________________________
-brian Black Holes suck. EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
bdelahunty
Posts: 38 Joined: 10/15/2004 Status: offline
|
RE: Inserting Session vars has me stumped - 5/29/2009 15:56:17
doesn't help. I thought there was a different syntax item, ' or " etc, like putting # around date variables that was missing
|
|
|
|
bdelahunty
Posts: 38 Joined: 10/15/2004 Status: offline
|
RE: Inserting Session vars has me stumped - 5/30/2009 14:50:55
Yoe were right about one of the session vars being null. fixed that and this is the response... INSERT INTO veh_parts (veh_id,part_name_id,part_num_id) VALUES ('9','20','47') works now. Thanks again!!
< Message edited by bdelahunty -- 5/30/2009 15:59:33 >
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|