Home > database >  Pb to connect to the database
Pb to connect to the database

Time:10-03

String ls_inifile="dsmis. Ini"
Sqlca. DBMS=ProfileString (ls_inifile, "database", "DBMS", "")
The sqlca. Database=ProfileString (ls_inifile, "database", "database", "")
The sqlca. Logid=ProfileString (ls_inifile, "database", "logid", "")
The sqlca. Logpass=ProfileString (ls_inifile, "database", "LogPassWord", "")
The sqlca. Servername=ProfileString (ls_inifile, "database", "servername", "")
The sqlca. Dbparm=ProfileString (ls_inifile, "database", "dbparm", "")
The sqlca. UserId=ProfileString (ls_inifile, "database", "userId", "")
The sqlca. DBPass=ProfileString (ls_inifile, "database", "DBPass", "")
The sqlca. Lock=ProfileString (ls_inifile, "database", "Lock", "")
The sqlca. The autocommit=false;
Connect using the sqlca;
If the sqlca. Sqlcode & lt;> 0 then
Messagebox (" database connection ", "the sqlca. Sqlerrtext")
Return
The else
Open (mian)
End the if
When I was running tips sqlca sqlerrtext, please help me to see is there out of the question

CodePudding user response:

Your database connection keywords are taken from the ini file,
Will ProfileString (ls_inifile, "database", "DBMS", "") after defining variables one by one to see if there is a return value,

CodePudding user response:

This should see dsmis. Ini configuration inside

CodePudding user response:

I view ls_inifile with brown way, this value is not straight have not changed,

CodePudding user response:

Messagebox (" database connection ", "the sqlca. Sqlerrtext")
Change
Messagebox (" database connection ", the sqlca sqlerrtext)

CodePudding user response:

Messagebox function format
MessageBox (title, text, {icon {, button, the default} {}})
There are the following parameters:
The title of the title represents messagebox, type string.

Text represents messagebox need to display content, type string;

The following is optional:
Icon represents messagebox to display the icon, as enumerated types, has the following legal value: information! (message, the default value); StopSign! (false); The Exclamation! (tip); Question! (questions); None! (do not display icon);

Button represents messagebox to display buttons, as enumerated types, has the following legal value: OK! (sure, the default value); OKCancel! (sure, cancel); YesNo! (yes, no); YesNoCancel! (yes, no, cancel); RetryCancel! (try again, cancel); AbortRetryIgnore! (interrupt, retry, ignore);

As the default button in the default represents messagebox keys, its value is: 1 (default); 2; 3

Messagebox function return value as an integer, execute successfully, returns the value of the selected key failure return 1; If any parameter is null, it returns null

CodePudding user response:

Pick up points is king!

CodePudding user response:

A little difficulty oh

CodePudding user response:

What ah
  • Related