Hello ,
I try to use the defined datatypes from adodef.ch , i can only test in ADO , *.mdb or *.accdb
The goal is that the syntax is also accepted in MySql , MsSql , Oracle and Sqlite (see Adofuncs.prg)
Some defines are accepted in the syntax as :
[Fld2] TynyInt
where TynyInt comes from adoDef.ch : #define adTinyInt 16
(removing ad)
Is it safe to use this defines this way for all the DNS ?
Or
1) must we create a table as :
ADO MSSQL MYSQL ORACLE SQLITE
16 TinyInt TinyInt TinyInt TinyInt TinyInt
If so , where can i find this field definitions ?
Or
2) Can the field definition be made with the numeric var (16 in this example)
Frank
Ado : Field Definition
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Ado : Field Definition
Different RDBSs have different field types. Not all field types are available in all Databases. We need to learn about every Database and choose appropriate field types of that Database to create tables. Typically we need to write an sql statement with the field specifications to create a table and execute the sql statement. If we write an application to work with different databases, we need to write conditionally different sql statements.
FW Ado functions simplify this task. We can use the function:
FWAdoCreateTable( cTable, aCols, oConnectionObject, [lAddAutoInc] ) --> lSuccess
where aCols is a structure exactly like DBSTRUCT() of DBF tables.
This function detects the database from the "oConnectionObject" and chooses appropriate field types and specs and generates sql statement suitable for that database. As of now, this function can handle MSACCESS, MYSQL, SQLITE, MicrosoftSQL, ORACLE for this purpose.
FW Ado functions simplify this task. We can use the function:
FWAdoCreateTable( cTable, aCols, oConnectionObject, [lAddAutoInc] ) --> lSuccess
where aCols is a structure exactly like DBSTRUCT() of DBF tables.
This function detects the database from the "oConnectionObject" and chooses appropriate field types and specs and generates sql statement suitable for that database. As of now, this function can handle MSACCESS, MYSQL, SQLITE, MicrosoftSQL, ORACLE for this purpose.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India