Database

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bernard.

I'm looking for informations about MSJET40.DLL to try to make an database application.

Is someone can help me ?


BDu
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Iontichy.
I'm looking for informations about MSJET40.DLL to try to make an database application.
If i'm not completly wrong, you can create a new ODBC connection with the Jet-drivers (control panel / ODBC) to get a database connection.
Is this a access database?

---------------
star traveler
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bernard.

Yes this is an Access Database.

I try to use MSJET40.DLL API because I can't read every type of Access fields with the standard function in PureBasic (ie DateTime fields)

Thanks if you can help me

BDu
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Iontichy.

Is it usefull to convert the DateTime column to a string in the query?
Like this:

Code: Select all

 
select firstname,lastname,CStr(birthday) as birthday
from t_person


---------------
star traveler
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bernard.

In fact I would like to do something more generic to read any table without to know the type of the field

BDu
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Iontichy.

Then you have to use the ODBC API functions.
But this is VERY complex.

i.e.:
SQLRETURN SQLColAttribute_ (
SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
SQLUSMALLINT FieldIdentifier,
SQLPOINTER CharacterAttributePtr,
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLengthPtr,
SQLPOINTER NumericAttributePtr);

---------------
star traveler
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

If you are reading an Access type database, you don't need to know the field type... PB can read any field as a string.

You only need to know the field type when writing... since you cannot put string into a field defined to take numbers.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bernard.

Where can I find documentation and some samples about ODBC API ?

BDu
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Iontichy.

The only source i use is MSDN, but there should be more information in the internet.

---------------
star traveler
Post Reply