flat assembler
Message board for the users of flat assembler.

Index > Heap > Accessing MDB file without DSN?

Author
Thread Post new topic Reply to topic
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
Hello ALL!

Could somebody tell me the way to read MDB file without creating Data Sources in Control Panel (I mean reading database NOT through ODBC, ADO and all of these kind). Maybe somewhere exist some DLLs that I can put in the same directory with MDB and access to file through API of that DLLs?

The reason is: I try to connect and read MDB file as in Iczelion`s tutorial, connection is ok, but after executing SQLExecDirect appeared error and SQLGetDiagRec gave me "access violation" message. I assume that it happened beacause of not properly configured DSN.

_________________
dream of mind creates a monster
Post 22 Mar 2005, 14:37
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
(Hm, is MDB - MS Access database?) If you need namely this kind of database, you can check some Delphi sites for suitable library (as a rule Delphi developers doesn't like MS technologies and often develope independent libraries. Unfortunately, they are probably in Delphi component format, but .dll is possible too).
In general, if you need SQL database engine for your projects, beter use SQLite - it is very convenient for assembly programming, because of its size and speed. I have several projects with SQLite and I am very happy with it. Smile ( www.sqlite.org )

Regards.
Post 22 Mar 2005, 14:52
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
Yes, MDB is MS Access database.

As I know Delphi has "BDE Administrator" and it should be configured too.
Post 22 Mar 2005, 15:15
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
veach1 wrote:
As I know Delphi has "BDE Administrator" and it should be configured too.


Yes, BDE is Borland's answer to ODBC. But the truth is that Delphi developers doesn't like BDE too, because of the size, it needs install, drivers, etc. So, there are many component libraries and sometimes procedure libraries (in .dll) to connect to this or that database.
But again - MS Access is not the best database even for HLL programming, for assembly - not suitable at all.

Regards.
Post 22 Mar 2005, 15:56
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
It will be very good for me to find such a procedure libraries.
Quote:
MS Access is not the best database even for HLL programming

I know, but my task is to write viewer for an existing MDB file Sad, and of course it must be non-dependible of hardware and software on any WIN vresion.

_________________
dream of mind creates a monster
Post 22 Mar 2005, 19:13
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
veach1 wrote:
I know, but my task is to write viewer for an existing MDB file Sad, and of course it must be non-dependible of hardware and software on any WIN vresion.


Hm, I have an idea (maybe I am not good adviser, because I never work with MS Access databases, but anyway...): As far as Access is not client-server database, there should be some MS library for work with such databases. And if you have MS Access installed (or even some other part of MS office) it is possible you have this library on your disk somewhere... Maybe you should search MSDN for the library name or even description of the functions... Well, that's all I can help you. Good luck. Smile

Regards
Post 22 Mar 2005, 19:44
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
Quote:
Well, that's all I can help you. Good luck. Smile

Thank you Smile
Post 23 Mar 2005, 07:32
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
It's been a while since I played with ODBC, but I remember working with .mdb files without setting up a DSN. I use a string like DRIVER={Microsoft Access Driver (*.mdb)};DBQ=myfile.mdb on the call to SQLDriverConnect.

Your access violation is probably something different - (lack of) register preservation, buffer overflow, unaligned stack etc. The only ODBC code I have is in C, but it should be straightforward to convert to assembly - I can post it if you want.
Post 23 Mar 2005, 10:46
View user's profile Send private message Visit poster's website Reply with quote
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
I`ll try to explain the error (more precise than above).
I used SQLDriverConnect (all like in Iczelion`s tutorial), SQLExecDirect used "SELECT * FROM table1" query and after it SQLGetDiagRec returned SQLSTATE equal to 42000 (Syntax error or access violation), I never thought that "SELECT * FROM table1" could have syntax error. Before SQLExecDirect no errors at all.

Quote:
The only ODBC code I have is in C, but it should be straightforward to convert to assembly - I can post it if you want.

The trick is that I`m trying to write it in C--, so please, post your C code.
Post 23 Mar 2005, 11:56
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Ok, have a look at http://flork.dk/junk/moviedb.rar - the code is ~3 years old and I haven't looked at it since. Hope it helps Smile
Post 24 Mar 2005, 15:43
View user's profile Send private message Visit poster's website Reply with quote
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
I`ve found the solution just couple of hours before your post. Smile

Anyway, thank you wery much for your code!
Post 24 Mar 2005, 18:54
View user's profile Send private message Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav
f0dder, can you reup moviedb.rar? 10x
Post 02 Nov 2009, 06:34
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Going to attach it here, enjoy Smile


Description:
Download
Filename: moviedb.rar
Filesize: 6.69 KB
Downloaded: 82 Time(s)


_________________
Image - carpe noctem
Post 02 Nov 2009, 07:42
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8961
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
so whats the solution? Care to share,otherwise next time when people found this thread,it got no solution but a only notification that solution was found.
Post 03 Nov 2009, 08:36
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.