I find that I cannot insert a memo field more than 254 chars, as if the driver thinks I'm trying to insert into a character field. I have read Carl Warner's suggestion on using SQLPREPARE:
PRB: SQLPREPARE Limited to 254 Characters http://support.microsoft.com/default.aspx?scid=kb;en-us;195525
...But I don't know how to code SQLPREPARE into C#.NET. Any suggestions?
For your reference...Here's the SQL statement, part of whose purpose is to write out to a memo field the SQL statement for debugging purposes to SCANRSLT file. The "DETAILS" field into which the offending string goes is defined as a memo field in scanrslt. Scanrslt is a foxpro free table. It's a bit tricky reading b/c I'm putting the SQL statement text into the DETAILS field. I also replaced certain characters with question mark ("?") character so as not to confuse the driver. Any ideas?
INSERT INTO scanrslt (compid,batch,sequence,key1,itqty,scanqty,itwgt,scanwgt,datestamp,timestamp,workid1,workid2,status,userid,xbatch,delete,wgtadj,creadj,itpal,scanpal,details) VALUES ('WMS0','0008359','000','No Data',0,0,0,0,{^2007-11-09},'12:15:11',633012619,157880306,'No Records from Scanner could be found to commit - in CommitOutScanbatch_Starch','','','N',0,'',0,0,'Could not find any records from outscan using this SQL :SELECT o.batch, o.newseqce, im.custcode, im.code2, sum(phy_mst.qty) as TPhyMstqty, im.o_qty, im.o_wgt1, im.o_wgt2,im.o_spc, im.qty, im.c_qty, im.wgt1, im.wgt2, im.spc, im.c_wgt1, im.c_wgt2, im.c_spc, count(o.batch) as pal, sum(phy_mst.pal) as pmpal, Im.BSM, LOADOUT.DATE, max(O.USERID) as userid, LOADOUT.DATE-1 as prevdate,sum(phy_mst.PalWgt) as TPalWgt, sum(o.PalWgt) as TScanPalWgt, code2.palcatch, max(im.key1) as key1 FROM ?C:?WMS65?outscan? o, INV_MST im, LOADOUT, PHY_MST,CODE2 WHERE o.compid=?WMS0? AND o.workid1 = 633012619 AND o.workid2 = 157880306 AND o.batch = ?0008359? AND loadout.batch = ?0008359? AND o.bsm = im.bsm AND phy_Mst.ID= LEFT(o.rawscan+Space(16),16) AND phy_mst.Rectype = ?O? AND PHY_MST.QTY > 0 AND im.custcode+o.code2 = code2.custcode+ code2.code2 GROUP BY o.batch, o.newseqce, im.bsm, im.custcode, im.code2, im.o_qty, im.o_wgt1, im.o_wgt2, im.o_spc, im.qty, im.c_qty, im.wgt1, im.wgt2, im.spc, im.c_wgt1, im.c_wgt2, im.c_spc, IM.BSM, LOADOUT.DATE,palcatch ORDER BY o.batch, o.newseqce, im.bsm, im.custcode, im.code2, im.o_qty, im.o_wgt1, im.o_wgt2, im.o_spc, im.qty, im.c_qty, im.wgt1, im.wgt2, im.spc, im.c_wgt1, im.c_wgt2, im.c_spc, IM.BSM, LOADOUT.DATE,palcatch')
Driver version: Visual Foxpro OLE DB 9.0 Provider. using Admin, ODBC, I create with a System DSN entry with foxpro Free tables checked. Note that HostDatabaseConnectionString = "Provider=VFPOLEDB.1;Data Source=" + HostDatabaseDirectory();
|