Re: Stupid Access and INSERT
Quote:
Originally posted by ober5861
I've tried doing a search for a solution, but to no avail.
VB Code:
CN.Execute "INSERT INTO Part_Info ( ID, Man, Cur, Desc )" & _
"Values('" & arrAdd(0) & "', '" & arrAdd(1) & "', '" & arrAdd(2) & "', '" & arrAdd(3) & "')"
Well, there's probably two things here, but one is causing your main error.
1) numbered fields complain when you have the single quotes around it, such as Num = '3' whereas the SQL usually wants Num = 3. For text fields, use the single quotes. For numbers, without.
2) be careful on inserting a specific PK. If the number is autogenerated, you don't even have to insert it at all (should be inserted automatically..)
I could be wrong, but that's what I'd try. Also, Fungi has a good idea of testing out your sql statement in access. :)
Destined