M
murray1840 via AccessMonster.com
I am trying to take a foxpro 7 table and copy it to access to make a access
mdb. I have included the code I am using. The code posted works as far as
making my MDB and new table and so far it copys some records to the new
access table. I have 27 fields I need to get copied but I cant seem to get
passed 11 fields I keep getting a " Command contains unrecognized phase\
keyword" error. Any help would be great.
Murray
*-- connect to Access
lcConnectionStr = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
"Dbq=c:\foso\foso.mdb;" +;
"Uid=Admin;" +;
"Pwd=;"
lnAccess = SQLSTRINGCONNECT(lcConnectionStr)
*-- open VFP table to export
USE "C:\foso\form1.DBF"
*-- optionally create the table in Access
SQLEXEC(lnAccess, "CREATE TABLE form2 (uic varchar(5), calendr_yr varchar(2),
serial_no varchar(3), srvc_code varchar(1), form_type varchar(8),priority
varchar(1),activity varchar(40),address varchar(120),poc varchar(25),
dsn_number varchar(15),com_number varchar(15))")
*-- create SPT cursor
?SQLEXEC(lnAccess, "SELECT * FROM form2", "form2")
*-- make SPT cursor updatable
CURSORSETPROP("Buffering", 5)
CURSORSETPROP("Tables", "form2")
CURSORSETPROP("UpdatableFieldList", "uic,calendr_yr,serial_no,srvc_code,
form_type,priority,activity,address,poc,dsn_number,com_number")
CURSORSETPROP("UpdateNameList", 'uic form2."uic", calendr_yr form2.
"calendr_yr",serial_no form2."serial_no",srvc_code form2."srvc_code",
form_type form2."form_type", priority form2."priority",activity form2.
"activity", address form2."address", poc form2."poc",dsn_number form2.
"dsn_number",com_number form2."com_number'")
CURSORSETPROP("SendUpdates", .t.)
*-- append data from VFP table. Note that at this stage you can do anything
APPEND FROM DBF("form1")
*-- committ changes to Access
?TABLEUPDATE(.t.)
mdb. I have included the code I am using. The code posted works as far as
making my MDB and new table and so far it copys some records to the new
access table. I have 27 fields I need to get copied but I cant seem to get
passed 11 fields I keep getting a " Command contains unrecognized phase\
keyword" error. Any help would be great.
Murray
*-- connect to Access
lcConnectionStr = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
"Dbq=c:\foso\foso.mdb;" +;
"Uid=Admin;" +;
"Pwd=;"
lnAccess = SQLSTRINGCONNECT(lcConnectionStr)
*-- open VFP table to export
USE "C:\foso\form1.DBF"
*-- optionally create the table in Access
SQLEXEC(lnAccess, "CREATE TABLE form2 (uic varchar(5), calendr_yr varchar(2),
serial_no varchar(3), srvc_code varchar(1), form_type varchar(8),priority
varchar(1),activity varchar(40),address varchar(120),poc varchar(25),
dsn_number varchar(15),com_number varchar(15))")
*-- create SPT cursor
?SQLEXEC(lnAccess, "SELECT * FROM form2", "form2")
*-- make SPT cursor updatable
CURSORSETPROP("Buffering", 5)
CURSORSETPROP("Tables", "form2")
CURSORSETPROP("UpdatableFieldList", "uic,calendr_yr,serial_no,srvc_code,
form_type,priority,activity,address,poc,dsn_number,com_number")
CURSORSETPROP("UpdateNameList", 'uic form2."uic", calendr_yr form2.
"calendr_yr",serial_no form2."serial_no",srvc_code form2."srvc_code",
form_type form2."form_type", priority form2."priority",activity form2.
"activity", address form2."address", poc form2."poc",dsn_number form2.
"dsn_number",com_number form2."com_number'")
CURSORSETPROP("SendUpdates", .t.)
*-- append data from VFP table. Note that at this stage you can do anything
APPEND FROM DBF("form1")
*-- committ changes to Access
?TABLEUPDATE(.t.)