//-- get location of .exe assuming the .mdb is in the same folder //
cFILE := GetModuleFileName( GetInstance() )
aDIR := DIRECTORY( cFILE )
// where .exe started from is default directory //
nSTART := RAT( "\", cFILE )
cDEFA := SUBSTR(cFILE,1,nSTART-1)
xPROVIDER := "Microsoft.Jet.OLEDB.4.0"
xSOURCE := cDEFA+"\YourTable.mdb"
xPASSWORD := "xxxxxx"
xSTRING := 'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Jet OLEDB:Database Password='+xPASSWORD
function TestPW
local oCn, oRs
local cmdb := "tutorpw.mdb"
local pwd := "12345"
if ! File( cmdb )
if ! FW_CreateMDB( cmdb, pwd )
? "MDB Create Fail"
return nil
endif
endif
oCn := FW_OpenAdoConnection( cmdb + "," pwd )
if oCn == nil
? "Connect fail"
return nil
endif
FW_AdoImportFromDBF( oCn, "c:\fwh\samples\CUSTOMER.DBF" )
xbrowser fw_adotables( oCn )
oRs := FW_OpenRecordSet( oCn, "CUSTOMER" )
? oRs:State
xbrowser oRs
oRs:Close()
oCn:Close()
return nil
bpd2000 wrote:Dear All,
I am unable to get connection using
oCn := FW_OpenAdoConnection( cmdb + "," + pwd )
when file extension of Access file is changed from .mdb to .bds
I need help how to connect
function FW_AdoConnectionString( cConnSpec, nDb )
.../...
elseif cExt $ "mdb,accdb,bds"
cRDBMS := "MSACCESS"
.../...
bpd2000 wrote:Thank you for reply
I tested but not succesful
Error as : Error description: Error BASE/1109 Argument error: $
? cExt
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 109 guests