Hello,
I need help in reading mdb file and storing table to dbf
I am using following code but gives me connection error in some machines.
Need another approach
Thanks in advance
ps : If i open this myfile.mdb via double clicking it opens properly
My purpose is only to read from access table any urgent help is required. Instead of sqlstringconnect can i use any other approach?
temp_dir = "C:\temp"
m_fname = temp_dir + "\add1.dbf"
delete file &m_fname
m_string = []
m_drv = sys(5)
m_filename = m_drv + "\myfolder\myfile.mdb"
naccesshandle = sqlstringconnect( "DRIVER=Microsoft Access Driver (*.mdb, *.accdb); DBQ=&m_filename;Pwd=mypwd" )
if naccesshandle < 1
messagebox( "Invalid connection to DATA" )
return
endif
*/ Valid handle, now, query down the data to a local VFP cursor
nsqlans = sqlexec( naccesshandle, "select * from myfile", "C_CursorInVFP" )
if nsqlans < 1
messagebox( "Unable to get any data..." )
sqldisconnect( naccesshandle )
return
endif
*/ Done with connection
sqldisconnect( naccesshandle )
select c_cursorinvfp
copy to &m_fname
sele c
use &m_fname
brow
I need help in reading mdb file and storing table to dbf
I am using following code but gives me connection error in some machines.
Need another approach
Thanks in advance
ps : If i open this myfile.mdb via double clicking it opens properly
My purpose is only to read from access table any urgent help is required. Instead of sqlstringconnect can i use any other approach?
temp_dir = "C:\temp"
m_fname = temp_dir + "\add1.dbf"
delete file &m_fname
m_string = []
m_drv = sys(5)
m_filename = m_drv + "\myfolder\myfile.mdb"
naccesshandle = sqlstringconnect( "DRIVER=Microsoft Access Driver (*.mdb, *.accdb); DBQ=&m_filename;Pwd=mypwd" )
if naccesshandle < 1
messagebox( "Invalid connection to DATA" )
return
endif
*/ Valid handle, now, query down the data to a local VFP cursor
nsqlans = sqlexec( naccesshandle, "select * from myfile", "C_CursorInVFP" )
if nsqlans < 1
messagebox( "Unable to get any data..." )
sqldisconnect( naccesshandle )
return
endif
*/ Done with connection
sqldisconnect( naccesshandle )
select c_cursorinvfp
copy to &m_fname
sele c
use &m_fname
brow