Thema: Delphi Create an ODBC Driver

Einzelnen Beitrag anzeigen

mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#6

Re: Create an ODBC Driver

  Alt 12. Feb 2007, 21:06
Zitat von shmia:
Do you know microsoft's ODBC documentation ?
http://msdn2.microsoft.com/en-us/library/ms709326.aspx
You need several weeks to fully understand how to write a ODBC driver.
You have to implement about 15 to 25 functions in your ODBC DLL.
yes sir , that's what i did the problem is with the DLL Exported Functions especiqlly with ConfigDriver and ConfigDSN functions.
so what i did :
i imlemented a unit named ODBCConst : where i declared all the Functions and this is a simple of the Unite :
Delphi-Quellcode:
function SQLAllocConnect(henv :Longint;var phdbc :Longint): Integer;
   stdcall;
function SQLAllocEnv(var phenv :Longint): Integer;
   stdcall;
function SQLAllocStmt(hdbc :Longint;var phstmt :Longint): Integer;
   stdcall;
function SQLBindCol(hstmt :Longint;icol :Word; fCType :Smallint;
   var rgbValue ;cbValueMax :Longint;var pcbValue): Integer;
   stdcall;
function SQLBindParameter(StatementHandle :Longint; ParameterNumber :Word;
   InputOutputType :Smallint; ValueType :Smallint;
   ParameterType :Smallint;
   ColumnSize :Longint; DecimalDigits :Smallint;
      ParameterValuePtr : Pointer;
   BufferLength :Longint;
      StrLen_or_IndPtr : Pointer
      ): Integer;
   stdcall;
function SQLConfigDriver(
  hwndParent: HWND;
  fRequest: WORD;
  lpszDriver: LPCSTR;
  lpszArgs: LPCSTR;
  lpszMsg: LPSTR;
  cbMsgMax: WORD;
  var pcbMsgOut: WORD): BOOL; stdcall;
 function ConfigDSN(
  hwndParent: HWND;
  fRequest: WORD;
  lpszDriver: LPCSTR;
  lpszAttributes: LPCSTR): BOOL; stdcall;
.....
ok as you see i have declared the functions SQLConfigDriver , and ConfigDSN
i export these 2 functions from the DLL File ( the ODBC Driver ), and i use a form to config the DSN the Driver is installed in the ODBC manager but the Result is so is there any thing wrong here
.

if you want i can send you my ODBC Driver and you can see or help . ,any thanks

if possible could you please send me an exe,ple of an ODBC Driver .

Regards MICHY
  Mit Zitat antworten Zitat