Delphi調用一個外部Dll的問題?
如題!Delphi調用一個外部Dll,只有一個Dll文件和該Dll的一段說明!
請高手進來,看看如何調用這個DLL?分不夠可加!!!
Dll文件名:dbx32sql.dll
Dll文件說明如下:
To use this you have one of two constructors to use. Please see example execution below.
string dbName = "Temp_zcgl";
string serverName = "172.20.1.107";.
string username = "shopfloor";
string userpwd = "shopfloor";
/// Using the standard constructor and inputing all information
/// From the constructor. This will automatically instantiate the setConnection Member
private dbx32sql.Connect conn = new dbx32sql.Connect(dbName, serverName, username, userpwd);
/// Using the non standard constructor with no inputs. Must initiate setConnection;
private dbx32sql.Connect conn = new dbx32sql.Connect();
conn.Database = dbName;
conn.Server = serverName;
conn.username = username;
conn.userpwd = userpwd;
conn.setConnection;
try
{
if (conn.Open)
{
string sqlGet = "SELECT COUNT (ID) FROM authors";
SqlCommand cmdGet = new SqlCommand(sqlGet, conn.Connection);
int Count = (int)cmdGet.ExecuteScalar();
CmdGet.Dispose();
}
else
{
// Input your error handling here;
}
}
catch(Exception ex)
{
//insert other error handling.
}
finally
{
conn.Close();
}
請高手進來,看看如何調用這個DLL?分不夠可加!!!