 |

04-17-2010, 04:25 AM
|
 |
Regular
|
|
Join Date: Sep 2005
Location: Cebu Phillippines
Posts: 62
|
|
NH: Implicit conversion varchar to binary
|
I'm running into trouble with my vb6 insert statement please help:
i got this error message:
Implicit conversion from data type varchar to binary is not allowed. use the CONVERT function to run this query.
Here's my insert statement in vb6:
Code:
cnSQL.Execute "INSERT INTO POP10100 (PONUMBER,POSTATUS,STATGRP,POTYPE,USER2ENT,CONFIRM1,DOCDATE,LSTEDTDT,LSTPRTDT,PRMDATE,PRMSHPDTE,REQDATE,REQTNDT,SHIPMTHD,TXRGNNUM,REMSUBTO,SUBTOTAL,TRDISAMT,FRTAMNT,MSCCHAMT,TAXAMNT,VENDORID,VENDNAME,MINORDER,VADCDPAD,CMPANYID,PRBTADCD,PRSTADCD,CMPNYNAM,CONTACT,ADDRESS1,ADDRESS2,ADDRESS3,CITY,STATE,ZIPCODE,COUNTRY,PHONE1,PHONE2,PHONE3,FAX,PYMTRMID,DSCDLRAM,DSCPCTAM,DISAMTAV,DISCDATE,DUEDATE,TRDPCTPR,CUSTNMBR,TIMESPRT,CREATDDT,MODIFDT,PONOTIDS_1,PONOTIDS_2,PONOTIDS_3,PONOTIDS_4,PONOTIDS_5,PONOTIDS_6,PONOTIDS_7,COMMNTID,CANCSUB,CURNCYID,CURRNIDX,RATETPID,EXGTBLID,XCHGRATE,EXCHDATE,TIME1,RATECALC,DENXRATE,MCTRXSTT,OREMSUBT,ORSUBTOT,Originating_Canceled_Sub,ORTDISAM,ORFRTAMT,OMISCAMT,ORTAXAMT,ORDDLRAT,ODISAMTAV,BUYERID,ONORDAMT,ORORDAMT,HOLD,ONHOLDDATE,ONHOLDBY,HOLDREMOVEDATE,HOLDREMOVEBY,ALLOWSOCMTS,DISGRPER,DUEGRPER,Revision_Number,Change_Order_Flag,PO_Field_Changes,PO_Status_Orig)values " & _
"('" & "IS-30658" & "','" & 1 & "','" & 1 & "','" & 1 & _
"','" & "JOELM" & "','" & "" & "','" & "2010-04-17" & _
"','" & "2010-04-17" & "','" & "1900-01-01" & _
"','" & "2010-04-17" & "','" & "1900-01-01" & _
"','" & "1900-01-01" & "','" & "1900-01-01" & _
"','" & SHIPMENT & "','" & "" & "','" & 10.12345 & _
"','" & 10.12345 & "','" & 0 & "','" & 0 & "','" & 0 & _
"','" & 0 & "','" & "2108PC-IS" & "','" & _
"WARAKALABOT CHARS - CHARS" & "','" & 0 & _
"','" & "TOKYO" & "','" & 1 & "','" & "PRIMARY" & "','" & "PRIMARY" & _
"','" & "PENTAX CEBU PHILIPPINES CORP." & "','" & "KETHYL G. LARGO" & _
"','" & "MACTAN ECONOMIC ZONE" & "','" & "" & "','" & "" & "','" & "LAPU-LAPU CITY,CEBU" & _
"','" & "" & "','" & 6015 & "','" & "PHILIPPINES" & "','" & "032-34005051190" & "','" & "03234005061225" & _
"','" & "" & "','" & "03234005000000" & "','" & "120 DAYS" & "','" & 0 & "','" & 0 & "','" & 0 & "','" & "1900-01-01" & _
"','" & "2010-04-17" & "','" & 0 & "','" & "" & "','" & 0 & "','" & "2010-04-17" & "','" & "2010-04-17" & "','" & 0 & _
"','" & 0 & "','" & 0 & "','" & 0 & "','" & 0 & "','" & 0 & "','" & 0 & _
"','" & "" & "','" & 0 & "','" & "Z-US$" & "','" & 1016 & "','" & "SELL" & "','" & "Z-USD-SELL" & _
"','" & 10.00123 & "','" & "2010-04-17" & _
"','" & "1900-01-01" & "','" & 0 & "','" & 0 & "','" & 0 & "','" & 8.00123 & _
"','" & 8.00123 & "','" & 0 & "','" & 0 & "','" & 0 & "','" & 0 & "','" & 0 & "','" & 0 & "','" & 0 & _
"','" & "" & "','" & 8.00123 & "','" & 8.00123 & _
"','" & 0 & "','" & "1900-01-01" & "','" & "" & _
"','" & "1900-01-01" & "','" & "" & "','" & 0 & "','" & 0 & _
"','" & 0 & "','" & 0 & "','" & 0 & "','" & 0 & "','" & 1 & "')"
|
__________________
________________________________________
- Don't cry bcoz its over, Smile bcoz it happens...
|

04-20-2010, 02:09 PM
|
 |
Google Hound
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Arizona, USA
Posts: 12,378
|
|
- [(]First, BREAK UP THE FIRST LINE IN YOUR SQL INSERT STATEMENT!!! Long program lines screw up the post formatting.
- Next, Dim and Build a string to hold the SQL statement. ex:
Code:
dim strSQL as string
strSQL = "Insert into YourTable (Field1, Field2, Field3) Values (1, 2, 'Description')
cn.execute strSQL
NOW, if you add a breakpoint to your code, you can debug.print strSQL, and this will send the actual string to be used to the interactive window. You can easily review the actual command, and, you can copy it from the window, and paste it here...
- What kind of database are you using? It can make a difference.
- Finally, WHAT is the table definition involved - in particular, all the field definitions??? If we don't know the field types, how could we direct you, except in the most vague replies?
|
__________________
Lou
"I have my standards. They may be low, but I have them!" ~ Bette Middler
"It's a book about a Spanish guy called Manual. You should read it." ~ Dilbert
"To understand recursion, you must first understand recursion." ~ unknown
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|