Home > database >  The installation program automatically registered access data sources?
The installation program automatically registered access data sources?

Time:09-15

I use pb made up a small program, using the access database, the program to the user, I want the installer to automatic registration data, install shields and setup factory which can do? How to do? Or have other easier way?

CodePudding user response:

No data source is that ok?

CodePudding user response:

Not even the database data source?

CodePudding user response:

Refer to this example

http://www.yesky.com/347/35347.shtml


In pb, don't in the installer to do, that there is no convenient in pb

CodePudding user response:

Don't use the data source that xp Windows 7 doing different registration
With OLE DB well

//====================================================================
//function: f_connect ()
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//description: connect the Access database
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//parameters:
//value string as_file - access database files address
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//return: Boolean
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//author: XXXX date: in 2013, 02 Nov. 09:43:07
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//modify history:
//
//====================================================================
String ls_LogPass, ls_Udl

Ls_LogPass="abc123,"
//write UDL
Ls_Udl="[oledb] ~ r ~ n; Everything after this line is an OLE DB initstring ~ r ~ n
"Ls_Udl +="Provider=Microsoft. Jet. The OLEDB. 4.0; User ID=Admin; Data Source="+ as_file +"; Persist Security Info=False; Jet OLEDB: Database Password="+ ls_LogPass
F_WriteFile (" Connect. Udl "ls_Udl," Unicode ")//udl requirement is Unicode

The Sqlca. DBMS="OLE DB"
The Sqlca. The AutoCommit=False
The Sqlca. DBParm="PROVIDER='4.0'. Microsoft Jet. The OLEDB., DATALINK='connect. Udl'"
Connect Using the Sqlca;
If the Sqlca. SQLCode=1 Then
MessageBox (' prompt ', 'database connection error. ~ r ~ n + Sqlca. SQLErrText)
Return False
End the If
Return True



//====================================================================
//function: f_writefile ()
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//description: a written to the specified format of the file, is used to generate the UNICODE \ UTF8 file
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//parameters:
//value string as_file filename
//value string as_str to write the contents of the
//value string as_typ file encoding type "UNICODE"/" utf-8 "
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//return: (none)
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//author: XXX date: on June 30, 2008,
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
//modify history:
//
//====================================================================
OLEObject ole_ADOStream
Ole_ADOStream=Create OLEObject
Ole_ADOStream. ConnectToNewObject (" ADODB. Stream ")
Ole_ADOStream. The Open ()
Ole_ADOStream. Position=0//Position of 0 to set Charset
Ole_ADOStream. Type=2//text data 2-1 - adTypeBinary adTypeText
Ole_ADOStream. Charset=as_typ
Ole_ADOStream. WriteText (as_str)
Ole_ADOStream. SaveToFile (as_file, 2)
Ole_ADOStream. Close ()
Destroy ole_ADOStream


CodePudding user response:

refer to the second floor jinchenghe response:
without data how to connect the database?

With parameters directly connected line don't have to try go to configure the data source reference to 4th floor
  • Related