wthat is string connection Ms Acces to mdb file with password
best regard
kajot
kajot
wthat is string connection Ms Acces to mdb file with password
best regard
kajot
//-- 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='+xPASSWORDFrom FWH 13.06 onwards we can open access (mdb or accdb) files with password using:
oCn := FW_OpenAdoConnection( <cmdbfilename>, <cpassword> )
The function internally builds the proper connection string.
Mr. Nages,
In source\function\adofuncions.prg this is what I have:
function Fw_OpenAdoConnection( cConnStr, lShowError )
Nothing about password.
Mr Lucas
Regret my inaccuracy in the syntax.
The correct syntax is:
oCn := FW_OpenAdoConnection( "<cmdbfilename>,<cpassword>" )
Example:
Create a password protected mdb file with:
FW_CreateMDB( "c:\mydata\tutor05.mdb", "mypassword" )
and open it with
oCn := FW_OpenAdoConnection( "c:\mydata\tutor05.mdb,mypassword" )
OR
oCn := FW_OpenAdoConnection( { "c:\mydata\tutor05.mdb", "mypassword" } )
thanks for answer
but if I use
cPath := cFilePath( ExeName() )
xSOURCE := cPATH+"waga.mdb"
xPASSWORD := "123456"
oCon := FW_OpenAdoConnection( xSOURCE,xPASSWORD)
cSQL:="select idklienta, nazwa, adres, nip from Klienci"
oRes := FW_OpenRecordSet( oCon, cSQL )
the function FW_OpenRecordSet( oCon, cSQL ) retrun error openning table Klienci
best regards
kajot
Please use:
oCon := FW_OpenAdoConnection( { xSOURCE, xPASSWORD } )
or
oCon := FW_OpenAdoConnection( xSOURCE + "," + xPASSWORD)
if I used function
oCon := FW_OpenAdoConnection( xSOURCE + "," + xPASSWORD)
the database opened good, but the function FW_OpenRecordSet can't open the table
cSQL:="select idklienta, nazwa, adres, nip from Klienci"
oRes := FW_OpenRecordSet( oCon, cSQL )
best regards
kajot
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 nilthanks a lot
I can't check up our program, because I have FWH v. 12.06
so I got many error
xLINK: error: Unresolved external symbol '_HB_FUN_FW_CREATEMDB referenced from (t.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_FW_ADOIMPORTFROMDBF referenced from (t.obj)'.
xLINK: error: Unresolved external symbol '_HB_FUN_FW_ADOTABLES referenced from (t.obj)'.
best regards
kajot
Creation and Opening of MDB files with password is available from 13.06 only.
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
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"
.../...Thank you for reply
I tested but not succesful
Error as : Error description: Error BASE/1109 Argument error: $
bpd2000 wrote:Thank you for reply
I tested but not succesful
Error as : Error description: Error BASE/1109 Argument error: $
? cExt