troubleshooting Question

Error in Insert into statement

Avatar of WolfManBN25
WolfManBN25 asked on
Microsoft Access.NET Programming
3 Comments1 Solution164 ViewsLast Modified:
I have a big long insert statement that was used prior, I have shortened it just to test it.

str_pp_sql = "INSERT INTO PRIVATE_FINAL(lastname, firstname, pcn, month, cert, phyupin) VALUES('" & txt_pp_lname.Text & "','" & txt_pp_fname.Text & "','" & txt_pp_pcn.Text & "', '" & ddl_pp_month.SelectedValue & "' ,'" & txt_pp_ptcert.Text & "','" & txt_pp_phyupin.Text & "')"

I added a drop down list with the months as a collection.  i have added the month field to table and have pcn, month, and cert as primary keys.  I have used this exact insert statement in access and it works.  The only different thing I did was use values instead of variables, (ie., "Doe","John",etc.).  Everytime I run the web application, I get an error message, syntax error in insert into statement.  I don't know why this won't work.

WolfMan
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros