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

This Code Works Fine (may need to b

Status
Not open for further replies.

imstillatwork

IS-IT--Management
Sep 26, 2001
1,605
US
This Code Works Fine (may need to be optimised though)
I want to add another row to the same table, If I copy this code and change the values (strDesc_1 to strDesc_2 etc..etc.. ) The second insert crpas out. It gives a error:
Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/test/POFORM/addrequest.asp, line 241
If I copy it exactly and insert the same values twice, it works. Why wont it allow new values in the second copy of the code.? (all in same ASP.)

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("admin/PO.mdb") & ";"


response.write (&quot;<br> &quot;&strID&&quot;&quot;)

strSQL = &quot;Insert Into tblItem([quantity],&quot; _
& &quot;[description],&quot; _
& &quot;[price],&quot; _

& &quot;[request_id] ) &quot; _

& &quot;Values('&quot;&cstr(strQ_1)&&quot;',&quot; _
& &quot;'&quot;&cstr(strdesc_1)&&quot;',&quot; _
& &quot;'&quot;&cstr(strUnitcost_1)&&quot;',&quot; _

& &quot;'&quot;&cstr(strID)&&quot;' )&quot;

response.write strSQL

Conn.Execute strSQL

Set conn= Nothing

all my variables are dimed and set correctly
why can't I change the values in the second copy of the code???
 
NEVER MIND!

.... some one explain to me the difference between an Integer and a String.......

. hmmm hmm hmmm hmmm....I'll just walk away slowly now......
 
Hehehe thanks Lobstah... sarcasm doesnt always come accros in type I guess. I had just overlooked cInt()...
 
i thought i detected your sarcasm, but on the off chance that you were REALLY asking.......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top