To build a conn. Ini file:
Content:
(Database)
The DBMS=MSSQL SQL Server 2000
The Database=elite
UserId=
DatabasePassword=
LogId=sa
LogPassword=admin
ServerName=IP address
DbParm=
The Lock=
Prompt=0
Clicked event like this:
Sqlca. DBMS=ProfileString (" conn. INI ", "database", "DBMS", "")
The sqlca. Database=ProfileString (" conn. INI ", "database", "database", "")
The sqlca. Logid=ProfileString (" conn. INI ", "database", "logid", "")
The sqlca. Logpass=ProfileString (" conn. INI ", "database", "LogPassWord", "")
The sqlca. Servername=ProfileString (" conn. INI ", "database", "servername", "")
The sqlca. Dbparm=ProfileString (" conn. INI ", "database", "dbparm", "")
The sqlca. The autocommit=true;
Connect using the sqlca;
If the sqlca. Sqlcode<> 0 then
MessageBox (" error ", "unable to connect to the database, question!)
The HALT Close
Return
The else
MessageBox (" prompt ", "connect to the database successfully," question!)
End the if
Don't know why the connection, the server user name is: sa password: admin
I fill in, don't know why not connect to database, depressed!!!!!!
CodePudding user response:
Set breakpoints and see the sqlca attribute values take the right, for example the sqlca. Logpass etc.I suggest ProfileString inside the parameters of the case and conn. Ini file case of the characters, and the sqlca. The autocommit=true; There should be no semicolon
CodePudding user response:
Set breakpoints and see the sqlca attribute values take the right, for example the sqlca. Logpass etc.I suggest ProfileString inside the parameters of the case and conn. Ini file case of the characters, and the sqlca. The autocommit=true; There should be no semicolon