Home > Back-end >  Delphi database connection many complains
Delphi database connection many complains

Time:09-26

MyHandle:=LoadLibrary (' DBConn. DLL);//load the DLL
@ SQLConnLib:=GetProcAddress call (myHandle, 'CreateSQLServerConn');//get the function in the DLL
Sqlconnection:=SQLConnLib (', 'master,' ', ');
QueryData:=sqlconnection. DoQuery (' select * from sys. The databases');
//connect the access database access features table
@ accessConnLib:=GetProcAddress call (myHandle, 'CreateAccessConn');//get the function in the DLL
Accconn:=accessConnLib (' fpconfig. Dat ', 'FPSearchInfor');
If not accconn. GetConnectState then
The begin
ShowMessage (' software data information read failed, please check the access data database! ');
The end;
Accquery:=accconn DoQuery (' select FPTableString from FPSearchInfor ');

While not accquery. Eof do
The begin
STR:=accquery FieldByName (' FPTableString). AsString;
ShowMessage (STR);
While not QueryData. (Eof) do
The begin
//ShowMessage (VarToStr (QueryData. You. Fields [' name '] Value));
//flag:=true;
//sqlconn:=SQLConnLib (', 'UFDATA_666_2014', ', ');
Sqlconn:=SQLConnLib (', '+ QueryData. You. The Fields [' name'] Value + "', ', ');
J:=1;
Table:=True;
//STR:=accquery FieldByName (' FPTableString). AsString;
//query dat file a list whether there is more than one table name
If (pos (' | ', STR)=0) then
The begin
//ShowMessage (' select the name from sysobjects where name in (' ' '+ accquery. You. Fields [' FPTableString] Value +' ' ') ');

This:=sqlconn DoQuery (' select the name from sysobjects where name in (" '" + STR + ") ");
//showmessage (this. You. Fields [' name '] Value);
//query the database if there is a characteristic table
If this. RecordCount> 0 then
The begin
Showmessage (QueryData. You. Fields [' name '] Value + 'is u8');
End
Else if this. RecordCount=0 then
The begin
Table:=false;
The end;
This. The Next;
The end;
//QueryData. Next;
While (pos (' | ', STR) & gt; 0) and (table=true) do
The begin
I:=pos (' | ', STR);
FPstr:=Copy (STR, 1, I - 1);
ShowMessage (' select the name from sysobjects where name in (' ' ' '+ FPstr +') ');
This:=sqlconn DoQuery (' select the name from sysobjects where name in (' ' ' '+ FPstr +') ');
//showmessage (this. You. Fields [' name '] Value);
If (this. RecordCount=0) then
//showmessage (QueryData. You. Fields [' name '] Value);
The begin
Table:=False;
continue;
The end;
If (this. RecordCount & gt; 0) then
The begin
Delete (STR, 1, I);
//ShowMessage (STR);
FPstr:=STR;
If (pos (' | ', STR)=0) then
The begin
This:=sqlconn DoQuery (' select the name from sysobjects where name in (' ' ' '+ FPstr +') ');
If (this. RecordCount=0) then
//showmessage (QueryData. You. Fields [' name '] Value);
The begin
Table:=False;
continue;
The end;

//this. Close;
//this. ClearFields;
//this. Open;
The end;
This. The Next;

The end;

//if it is true, then the database contains a column of a database table
//inc (j);
The end;
If (table=true) then
The begin
Showmessage (QueryData. You. Fields [' name '] Value + 'is u8');
The end;

QueryData. Next;
//ShowMessage (QueryData. You. Fields [' name '] Value);
The end;

Accquery. Next;
The end;

Access violation at address 00402256 in the module

CodePudding user response:

Database connection complains after many times, I don't know whether the connection too much cause problems, you great spirit enveloped genuflect is begged

CodePudding user response:

A big problem in many days, request a great god appeared!!!!!!!!!!!!!!!!!!!

CodePudding user response:

 
MyHandle:=LoadLibrary (' DBConn. DLL);//load the DLL
@ SQLConnLib:=GetProcAddress call (myHandle, 'CreateSQLServerConn');//get the function in the DLL
Sqlconnection:=SQLConnLib (', 'master,' ', ');
QueryData:=sqlconnection. DoQuery (' select * from sys. The databases');
//connect the access database access features table
@ accessConnLib:=GetProcAddress call (myHandle, 'CreateAccessConn');//get the function in the DLL
Accconn:=accessConnLib (' fpconfig. Dat ', 'FPSearchInfor');
If not accconn. GetConnectState then
The begin
ShowMessage (' software data information read failed, please check the access data database! ');
The end;
Accquery:=accconn DoQuery (' select FPTableString from FPSearchInfor ');

While not accquery. Eof do
The begin
STR:=accquery FieldByName (' FPTableString). AsString;
ShowMessage (STR);
While not QueryData. (Eof) do
The begin
//ShowMessage (VarToStr (QueryData. You. Fields [' name '] Value));
//flag:=true;
//sqlconn:=SQLConnLib (', 'UFDATA_666_2014', ', ');
Sqlconn:=SQLConnLib (', '+ QueryData. You. The Fields [' name'] Value + "', ', ');
J:=1;
Table:=True;
//STR:=accquery FieldByName (' FPTableString). AsString;
//query dat file a list whether there is more than one table name
If (pos (' | ', STR)=0) then
The begin
//ShowMessage (' select the name from sysobjects where name in (' ' '+ accquery. You. Fields [' FPTableString] Value +' ' ') ');

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related