ODBC
-
Hi all. I am currently looking to insert a value into a memo field in vfp using a odbc connection but keep getting a error (ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Data type mismatch). Does anybody know if this is supported by the odbc connection object or does anybody have sample code to do this. The sql is correct this thing just fails with the odbc connection.
Stephen Lintott Bsc IT (RAU)
-
Hi all. I am currently looking to insert a value into a memo field in vfp using a odbc connection but keep getting a error (ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Data type mismatch). Does anybody know if this is supported by the odbc connection object or does anybody have sample code to do this. The sql is correct this thing just fails with the odbc connection.
Stephen Lintott Bsc IT (RAU)
You say that the SQL is correct, what type of database have you tested it on? The reason I ask is because I believe that the required type of data can vary between database engines. If you haven't done so already (and I apologise if you have), I would test the SQL on the VFP database directly.
-
Hi all. I am currently looking to insert a value into a memo field in vfp using a odbc connection but keep getting a error (ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Data type mismatch). Does anybody know if this is supported by the odbc connection object or does anybody have sample code to do this. The sql is correct this thing just fails with the odbc connection.
Stephen Lintott Bsc IT (RAU)
-
Could yo post the code. Perhaps the problem is in the parameter usage.
The need to optimize rises from a bad design.My articles[^]
After a discusion with the developer in charge of this I found out that the following sql statement causes the break. If anyone can see why I would surely appreaciate it. I sure can't it seems correct to me.
INSERT INTO OrdHeader (Uniqueid,trantype,ledgerno,accountid,userno,entrydate,entrytime,lineno, trandate,periodno,batchno,internref,externref,hedgecode,logged,descriptn,payee,presented,held,previous,ositem,ledger2, account2,taxtype1,taxcode1,taxamount1,taxtype2,taxcode2,taxamount2,taxtype3,taxcode3,taxamount3,salescode,costcode,stage, branch,delivery,quantity1,quantity2,quantity3,amount1,amount2,amount3,amount4,amount5,cncycode,exchange,netvarnce,netgain, netloss,taxrebate,duedate,rateid,staffid,complqty,ppsrate,purchtype,isjobquote,rpsgross,recordno,temppres,changed,discperc, taxperiod,zcostproc,zpostatus) Values(5,49,2,'CNBPZF@CQU',1, CTOD('1/26/2009'),58694.616,0,CTOD('12/31/2008'),78, 356550,'PO-JAC01360 ','PO-JAC ','N','F' ,'Purchase Order ',' ',0,'F','F' ,'F',2,'CNBPZF@CQU',' ',0,0 ,' ',0,-69.96,' ',0 ,0,0,' 0',' 0',1 ,CTOD('12/31/2008'),0,0,0 ,-699.56,0,-699.56,0,0 ,0,1,0,0,0 ,0,CTOD('12/30/1899 12:00:00 AM'),'F ','F ',0 ,0,0,'F',0,0 ,0,'T',0,0,' ' ,' ')
Stephen Lintott Bsc IT (RAU)
-
After a discusion with the developer in charge of this I found out that the following sql statement causes the break. If anyone can see why I would surely appreaciate it. I sure can't it seems correct to me.
INSERT INTO OrdHeader (Uniqueid,trantype,ledgerno,accountid,userno,entrydate,entrytime,lineno, trandate,periodno,batchno,internref,externref,hedgecode,logged,descriptn,payee,presented,held,previous,ositem,ledger2, account2,taxtype1,taxcode1,taxamount1,taxtype2,taxcode2,taxamount2,taxtype3,taxcode3,taxamount3,salescode,costcode,stage, branch,delivery,quantity1,quantity2,quantity3,amount1,amount2,amount3,amount4,amount5,cncycode,exchange,netvarnce,netgain, netloss,taxrebate,duedate,rateid,staffid,complqty,ppsrate,purchtype,isjobquote,rpsgross,recordno,temppres,changed,discperc, taxperiod,zcostproc,zpostatus) Values(5,49,2,'CNBPZF@CQU',1, CTOD('1/26/2009'),58694.616,0,CTOD('12/31/2008'),78, 356550,'PO-JAC01360 ','PO-JAC ','N','F' ,'Purchase Order ',' ',0,'F','F' ,'F',2,'CNBPZF@CQU',' ',0,0 ,' ',0,-69.96,' ',0 ,0,0,' 0',' 0',1 ,CTOD('12/31/2008'),0,0,0 ,-699.56,0,-699.56,0,0 ,0,1,0,0,0 ,0,CTOD('12/30/1899 12:00:00 AM'),'F ','F ',0 ,0,0,'F',0,0 ,0,'T',0,0,' ' ,' ')
Stephen Lintott Bsc IT (RAU)
-
After a discusion with the developer in charge of this I found out that the following sql statement causes the break. If anyone can see why I would surely appreaciate it. I sure can't it seems correct to me.
INSERT INTO OrdHeader (Uniqueid,trantype,ledgerno,accountid,userno,entrydate,entrytime,lineno, trandate,periodno,batchno,internref,externref,hedgecode,logged,descriptn,payee,presented,held,previous,ositem,ledger2, account2,taxtype1,taxcode1,taxamount1,taxtype2,taxcode2,taxamount2,taxtype3,taxcode3,taxamount3,salescode,costcode,stage, branch,delivery,quantity1,quantity2,quantity3,amount1,amount2,amount3,amount4,amount5,cncycode,exchange,netvarnce,netgain, netloss,taxrebate,duedate,rateid,staffid,complqty,ppsrate,purchtype,isjobquote,rpsgross,recordno,temppres,changed,discperc, taxperiod,zcostproc,zpostatus) Values(5,49,2,'CNBPZF@CQU',1, CTOD('1/26/2009'),58694.616,0,CTOD('12/31/2008'),78, 356550,'PO-JAC01360 ','PO-JAC ','N','F' ,'Purchase Order ',' ',0,'F','F' ,'F',2,'CNBPZF@CQU',' ',0,0 ,' ',0,-69.96,' ',0 ,0,0,' 0',' 0',1 ,CTOD('12/31/2008'),0,0,0 ,-699.56,0,-699.56,0,0 ,0,1,0,0,0 ,0,CTOD('12/30/1899 12:00:00 AM'),'F ','F ',0 ,0,0,'F',0,0 ,0,'T',0,0,' ' ,' ')
Stephen Lintott Bsc IT (RAU)
I notice multiple booleans that appear as single character strings (
'T'
or'F'
). Are those fields actually character type or boolean type? In VFP.T.
and.F.
are used to indicate booleans. If you are using parameters for the ODBC command and assign a boolean value to them it should handle them for you, but if you are specifying their values in the command text then you may need to use the VFP boolean syntax.Hope in one hand and poop in the other; see which fills up first. Hope and change were good slogans, now show us more than words.
-
If you execute that directly against the database without your application, does it fail?
The need to optimize rises from a bad design.My articles[^]
It fails when running it against a RBDMS. The booleans don't cause any havoc. It inserts to9 the Description field and then no more
Stephen Lintott Bsc IT (RAU)
-
It fails when running it against a RBDMS. The booleans don't cause any havoc. It inserts to9 the Description field and then no more
Stephen Lintott Bsc IT (RAU)
Since I don't know the structure of your table, I'm not able to sy if all the values are in correct places. However, you could check if the pairs match (if not done so already) Here's the colum/value list in different format. The Descriptn value look quite large, perhaps it's over the max length?
Uniqueid 5
trantype 49
ledgerno 2
accountid 'CNBPZF@CQU'
userno 1
entrydate CTOD('1/26/2009')
entrytime 58694.616
lineno 0
trandate CTOD('12/31/2008')
periodno 78
batchno 356550
internref 'PO-JAC01360 '
externref 'PO-JAC '
hedgecode 'N'
logged 'F'
descriptn 'Purchase Order'
payee ' '
presented 0
held 'F'
previous 'F'
ositem 'F'
ledger2 2
account2 'CNBPZF@CQU'
taxtype1 ' '
taxcode1 0
taxamount1 0
taxtype2 ' '
taxcode2 0
taxamount2 -69.96
taxtype3 ' '
taxcode3 0
taxamount3 0
salescode 0
costcode ' 0'
stage ' 0'
branch 1
delivery CTOD('12/31/2008')
quantity1 0
quantity2 0
quantity3 0
amount1 -699.56
amount2 0
amount3 -699.56
amount4 0
amount5 0
cncycode 0
exchange 1
netvarnce 0
netgain 0
netloss 0
taxrebate 0
duedate CTOD('12/30/1899 12:00:00 AM')
rateid 'F '
staffid 'F '
complqty 0
ppsrate 0
purchtype 0
isjobquote 'F'
rpsgross 0
recordno 0
temppres 0
changed 'T'
discperc 0
taxperiod 0
zcostproc ' '
zpostatus ' 'The need to optimize rises from a bad design.My