![]() |
Create an ODBC Driver
< i'm very sorry to write in english , why in this forum : cause i have been told to post my question here in delphipraxis forum >. sorry again .
Hi every body , i have finished programming my DBMS ( a BDE replacment with my propre Table , Query , Database ) , my DBMS uses SQL 92 . so i want to create - write - my DBMS Driver. i have been told to convert my DBMS pas files into C or C++ then use MVC++ to create this ODBC Driver. could you please help me to create this ODBC Driver using Delphi . I really need your help. michy |
Re: Create an ODBC Driver
Why do you want to create in 2007 a ODBC-Driver?
If I use .NET i want a native ADO.NET Provider, if I use Delphi (Win32) I would like to see native TDataset-Components. No Installation of ODBC-Driver and no setup of ODBC-Entry. And for Win64 - there is no ODBC any more. |
Re: Create an ODBC Driver
yes sir of course , But i was asked by 2 of my customers to give them an odbc driver for my DBMS .
really i need all ur help regards michy |
Re: Create an ODBC Driver
please is there any help.
|
Re: Create an ODBC Driver
Do you know microsoft's ODBC documentation ?
![]() 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. |
Re: Create an ODBC Driver
Zitat:
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:
ok as you see i have declared the functions SQLConfigDriver , and ConfigDSN
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; ..... 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 :wall: 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 |
Re: Create an ODBC Driver
Therer is an PostGres driver availabe under
![]() |
Re: Create an ODBC Driver
Same for FireBird:
![]() |
Re: Create an ODBC Driver
Zitat:
|
Re: Create an ODBC Driver
i'm really still for someone to help me . :cry:
|
Re: Create an ODBC Driver
please is there any news .
regards |
Re: Create an ODBC Driver
Hi Michy, welcome to Delphi-PRAXiS.
You already have studied the Microsoft Documentation for ODBC, I understand. You also have implemented the required functions, but your first test failed. How do you test? Do you make good use of the Microsoft ODBC Test Program? A fully implemented v3 ODBC Driver is by no means a small project. Perhaps you should try to isolate small problem areas to attract more helpers. As soon as you focus on some detail, even members without explicit knowledge about ODBC drivers might be able to proof read your code. If you don't trust your own translation of the C header files you could give Dr. Bob's ![]() Kind Regards marabu |
Re: Create an ODBC Driver
I hope if someone can provide me with a Simple DLL ( ODBC Driver ) with it's source code , and especially the declarations of exported Functions .
Michy |
Re: Create an ODBC Driver
Zitat:
if you expect to get a sample source with a ODBC driver written in Delphi - i believe that such a driver does not exist. Most programmers (including myself) will study MS documentation and header files and so on and come to the conclusion, that it is senseless to convert all this stuff to Pascal, while the job could be done directly in C/C++. Maybe you do not believe this, but this does not change the reality. To be exact: i am sure, that it is possible to write ODBC drivers in Delphi, and i am equally sure, that it is absolutely senseless. And i am sure that i am not alone with this opinion. SY Reinhard |
Re: Create an ODBC Driver
OK thank you Reinhard Kern , let's suppose it's - a Little bit-impossible to build my DBMS ODBC Driver using Delphi so what shoud i do :
Should i convert all My DBMS Pas Files into C++ or what ? is it so hard to build ( i mean my DBMS ODBC Driver )it with C++ ? -- i have succedded in Translating ( Conversion ) of SQL.H , and the ODBC wraper into Pas file as you can see in my SImple Unite . could you please expliane me more especially about the 1st question , many thanks michy |
Re: Create an ODBC Driver
Not in the whole . He pointed out that you should implement the ODBC-Driver in c/c++.
|
Re: Create an ODBC Driver
Zitat:
Could you explaine me what are pointing on :roll: if it's a matter of ODBC needed File like Sql.H ... we can translate them into Pas files , my problem is in synchronising between the exported Function in the DLL file and the other Units . |
Re: Create an ODBC Driver
Hi mohfa,
you want to know if you can implement your ODBC driver using Delphi instead of C(++)? So rest assured and have a look at this implementation done by Gerrit Moeller: ![]() I'm not sure what your other problems are, but maybe they are gone after you had a peek at the code. Regards |
Re: Create an ODBC Driver
Zitat:
Of course you need not to port your software to C/C++ - you just use it from your driver written in C/C++. To give a simple example: there is surely a function to read a record from the database, and surely the ODBC driver needs this function at a certain point. The functionality of "ReadRecord" remains defined by Pascal if you have decided so in the past. Your newly created driver just calls this function - it does not really matter if from a Delphi or a C environment; between DLLs the language is not important and for direct calls you need some knowhow about calling conventions. But, as i said, maybe i dont understand anything. SY Reinhard |
Re: Create an ODBC Driver
hello again .
i want to know where should i declare my Dataset in mean i which Unite is it in : OdbcInst , OdbcConst Regards |
Re: Create an ODBC Driver
Hi mohfa,
neither ODBCInst nor ODBCConst seem to be proper names for Units that contain your BDE replacement components. Judging by name both Units could be part of your ODBC driver implementation. You could base your architectural decisions on a close study of the Units DB and DBTables. One thing is for sure: There should not be much dependency between your components and your driver. Regards |
Re: Create an ODBC Driver
Zitat:
|
Re: Create an ODBC Driver
As I understand the given (Borland) architecture you will have your own components (TMohfaDataSet e.a.) in a Unit named MOHFADB - to distinguish it from ADODB and others. Your TMohfaDataset should be derived from TCustomMohfaDataSet which in turn should inherit directly from TDataSet. Your task is to implement the abstract methods from TDataSet in your own class TCustomMohfaDataset and to publish a compatible (see TADODataset) set of properties in your class TMohfaDataset. Please make good use of the sources that came with your Delphi Enterprise Edition and make sure you read the relevant chapters in the documentation.
Regards |
Re: Create an ODBC Driver
Zitat:
SY Reinhard |
Re: Create an ODBC Driver
Hi Reinhard,
it wasn't me who started to write about TDataSet in the first place, but I think it is necessary anyway. I most certainly never did suggest to write a TDataSet-Successor in order to implement an ODBC-Driver. The original poster has informed us about his own implementation of an SQL-92 based (local) RDBMS by means of TTable, TQuery, TDatabase. Just to recap: He is looking for a way to present an ODBC driver to his client, so that other tools cann access the data, too. My suggestion to Mohfa is to start reading all the readily available documentation to learn about the architecture, so his components fit in nicely. At this moment he seems to mix up the two concepts (data-aware component vs. ODBC driver) badly. Even when local data access is implemented directly by his components, he will never succeed with his ODBC driver by trying to repackage his components. The first task should be to sort out the functionality that comprises a solid call level interface to his RDBMS. The CLI can then serve as the basis for the ODBC driver - and for the components as well. Regards |
Re: Create an ODBC Driver
Hi marabu
Zitat:
regards. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:10 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz