troubleshooting Question

Help with a SQL statment!

Avatar of cpfeiffer
cpfeiffer asked on
Visual Basic.NET
2 Comments1 Solution183 ViewsLast Modified:
Can anyone tell me what I am missing. I can not get this to work. Thanks

Here is the SQL information:
     Dim ado As New MyConn()
        Dim sql As String
        sql = "INSERT INTO CLINICORDER (ClinicName, SysSize, OwnerFirst, OwnerLast, Phone1, Phone2, ShipStreet, ShipCity, ShipState, ShipZip, DepositDate, DepositType, Pay1Date, Pay1, Pay2Date, Pay2, CCType, CC1, CC2, CC3, CC4, CCCVS, BillStreet, BillCity, BillState, BillZip) VALUES (" & _
        MyConn.SQL_String(txtName.Text) & "," & MyConn.SQL_String(cboSize.SelectedItem) & "," & MyConn.SQL_String(txtNameFirst.Text) & _
        MyConn.SQL_String(txtNameLast.Text) & "," & MyConn.SQL_String(txtPhone1.Text) & _
        MyConn.SQL_String(txtPhone2.Text) & "," & MyConn.SQL_String(txtShipStreet.Text) & _
        MyConn.SQL_String(txtShipCity.Text) & "," & MyConn.SQL_String(txtShipState.Text) & _
        MyConn.SQL_String(txtShipZip.Text) & "," & MyConn.SQL_String(dtpDeposit.Text) & _
        MyConn.SQL_String(cboDeposit.SelectedItem) & "," & MyConn.SQL_String(dtp1st.Text) & _
        MyConn.SQL_String(cboPayment1.SelectedItem) & "," & MyConn.SQL_String(dtp2nd.Text) & _
        MyConn.SQL_String(cboPayment2.SelectedItem) & "," & MyConn.SQL_String(cboCCType.SelectedItem) & _
        MyConn.SQL_String(txtCCno1.Text) & "," & MyConn.SQL_String(txtCCno2.Text) & "," & MyConn.SQL_String(txtCCno3.Text) & _
        MyConn.SQL_String(txtCCno4.Text) & "," & MyConn.SQL_String(txtBillStreet.Text) & _
        MyConn.SQL_String(txtBillCity.Text) & "," & MyConn.SQL_String(txtBillState.Text) & _
        MyConn.SQL_String(txtBillZip.Text) & ")"
        ado.ExecuteNonQuery(sql)
        ado.Dispose()

Here is what I get from that SQL statment.
INSERT INTO CLINICORDER (ClinicName, SysSize, OwnerFirst, OwnerLast, Phone1, Phone2, ShipStreet, ShipCity, ShipState, ShipZip, DepositDate, DepositType, Pay1Date, Pay1, Pay2Date, Pay2, CCType, CC1, CC2, CC3, CC4, CCCVS, BillStreet, BillCity, BillState, BillZip) VALUES ('Indiana','3 System Package','First Name''Last Name','Phone''OPhone2','123 Here''Fort Wanye','IN''45678','8/27/2005''Credit Card','8/27/2005''Check','8/27/2005''Cash','Visa''1','2','4''5','12''PHoenix','AZ''86503'

Thanks!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
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 2 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