-
May 25th, 2023, 06:44 PM
#1
Thread Starter
New Member
[RESOLVED] RC6 CreateTableFromADORs creating TEXT columns
Hi,
Is there any way to force RC6 CreateTableFromADORs to create VARCHAR columns instead of TEXT, in fields with less than 255 characters of data?
-
May 25th, 2023, 09:48 PM
#2
Re: RC6 CreateTableFromADORs creating TEXT columns
SQLite-Table-TextFields (no matter what type-description you use) - will always allow 0 to 2GB of characters
(via a dynamically changing len-descriptor which allows to keep the string-storage small and efficient)
May I ask, why you need that?
Olaf
-
May 25th, 2023, 10:08 PM
#3
Thread Starter
New Member
Re: RC6 CreateTableFromADORs creating TEXT columns
Hi Olaf,
Iīm using CreateTableFromADORs as a speedy middle step to download from Oracle (in the cloud) to a legacy MS Access database.
So I when I link the sqlite tables in MS Access (using ODBC), the TEXT Fields are considered as MEMO, and some inner joins with already existing string fields of the local tables (not imported) donīt work anymore.
Last edited by beltrao73; May 25th, 2023 at 10:11 PM.
-
May 26th, 2023, 01:09 AM
#4
Re: RC6 CreateTableFromADORs creating TEXT columns
 Originally Posted by beltrao73
...when I link the sqlite tables in MS Access (using ODBC),
the TEXT Fields are considered as MEMO
Ah, Ok.
In that case, you can use "the last optional parameter" (arrDataTypes As Variant):
It needs to be of type Variant and 2-dimensionally redimed beforehand: Redim (0 to AdoRs.Fields.Count-1, 0 to 1)
- arrDataTypes(i, 0) <-- 0 is for TypeNames (as e.g. Varchar) and all index-slots need to be filled completely for all Fields(i) in the Rs
- arrDataTypes(i, 1) <-- 1 is optional ... but if you set it, you will have to place an SQLite ColumnType-EnumValue there
HTH
Olaf
-
May 26th, 2023, 05:38 AM
#5
Thread Starter
New Member
Re: RC6 CreateTableFromADORs creating TEXT columns
Thanks again Olaf!
I created this function to dinamically map ADO Data Types to sqlite types and it worked just fine.
Code:
Function MapDataType ( ADODataType)
Select Case ADODataType
Case 2,3,16,20
ret = "INTEGER"
Case 4,5,14,131,139
ret = "REAL"
Case 129,200,201,202
ret = "VARCHAR"
Case 7, 133, 134, 135
ret = "DATETIME"
Case 11
ret = "BOOLEAN"
Case 204,205
ret = "BLOB"
End Select
MapDataType = ret
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|