Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Large ACCESS 95 ODBC headache
Message
From
12/11/2001 19:28:30
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Large ACCESS 95 ODBC headache
Miscellaneous
Thread ID:
00580677
Message ID:
00580677
Views:
37
Or, maybe I've just got the headache and this isn't helping....

I'm trying to insert a record into an Access 95 table and I either get a Syntax error (which is coming from trying to pass a numeric in a string) or, I get an error that says "Too few parameters. Expected x", where x is the number of fields in my Fields section....the chunk of code in question is...

dcfld = "PK_VEND,LOCALNUM,VENDORNUM,NAME,APPRSTAT,APPRYR," +;
"PHYSINCAREOF,PHYSADDR1,PHYSADDR2,PHYSCITY,PHYSCOUNTY," + ;
"PHYSFIPS,PHYSSTATE,PHYSZIP,PHYSZIP4,PHYSTELEPHONE," + ;
"BILLINGINCAREOF,BILLINGADDR1,BILLINGADDR2,BILLINGCITY," + ;
"BILLINGCOUNTY,BILLINGFIPS,BILLINGSTATE,BILLINGZIP," + ;
"BILLINGZIP4,BILLINGPHONE,ENROLLDT,VENDSTATUS,STATUSDT," + ;
"NEWSSNTID,OLDSSNTID,SPECCD,VENDTYPE,LASTLIQDDT,LASTAUTHDT," + ;
"GROUP,MCAIDPROVFLAG,MCAIDPROVNUM,FISCALFLAG,DIRECTDEPOSITFLAG," + ;
"NOTES,LASTCHGUSER,LASTCHGDT,CREATEDT,CREATEWHO"

insstr = "m.pkvend,val(m.cidcnum),m.vendid,m.vendname,m.apprstat,mapyr," + ;
"m.incareof, m.vendaddr1, space(30), m.vendcity, val(m.vendcnty)," + ;
"2*val(m.vendcnty) - 1, m.vendstate, m.vendzip5, m.vendzip4, m.vendphone," + ;
"vendmast.vendname, vendmast.vendaddr1, vendmast.vendaddr2, vendmast.vendcity," + ;
"val(vendmast.vendcnty), 2*val(vendmast.vendcnty)-1, vendmast.vendstate, vendmast.vendzip5," + ;
"vendmast.vendzip4, vendmast.vendphone, mdtfunc, m.vendstatus, m.vendstatdt," + ;
"m.vendnewssn, m.vendoldssn, m.specialty, m.vendtype, m.liqddate, m.authdate," +;
"iif(recc('indvs')>1,' ','C'), m.medprov, m.mednum, m.onfiscal, iif(vendmast.venddirdep,'Y','N')," +;
"m.notes, muserid, mdtfunc, mdtfunc, muserid"

msql1 = 'Insert into VendorMaster (' + dcfld + ') values (' + insstr + ')'
x = sqlexec(mchand,msql1,"drslts")

all of the variables are defined, mdtfunc = datetime() (Access apparently didn't like the function)

I've tried cutting it down to:
msql1 = "Insert into VendorMaster (pk_vend) values (m.pkvend)"
this gives me the "Parameters" error

I CAN get it to work with:
msql2 = "Insert into VendorMaster (pk_vend) values (28448)"
this works (after the sqlexec stmt).

Help me! Help me, ObiWan KeFoxPro!
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Next
Reply
Map
View

Click here to load this message in the networking platform