[AccessD] Create table script...so close...SOLVED!!

S D accessd667 at yahoo.com
Thu Apr 1 23:49:25 CST 2004


Hi Paul, Charlotte,
 
both db_Text and adVarChar where incorrect, thnx anyway.
 
The solution is: rapapapa...string! 
debug.print arrFileLayout(y, 6) 
string
 
Go figure.
 
Sander
 
PS: I know can import/export interface files using 4 'main' tables.
tblInterface ( stores interface ID and direction (import/ export)
tblInterfaceData (Staging table: stores every line of the interface)
tblInterfaceLayout (stores the positions/fields/mandetory/PK/FK/etc/etc for every interface added to tblInterface, is also used to check tblInterfaceData for incorrect data)
tblInterfaceDistribution (Stores tags and such (if any) to identify wich line of data must be exported to wich table eg tag JUR0-I must be exported to tbl_GAS_1020_MI) 
 
:-)
 
I know there are a lot of interfaces this stuff doesn't work for but....
 

paul.hartland at fsmail.net wrote:
Just a thought have you tried dbText instead:
arrFileLayout(y, 6) contains the field type (=dbText)
Paul






Message date : Apr 01 2004, 02:57 PM
>From : "S D" 
To : "accessd" 
Copy to : 
Subject : [AccessD] Create table script...so close...
Hi group,

I need to create tables using the layout specified in a certain table. I found the SUB below on msdn.microsoft.com. Changed it a bit and voila the tables are created! HOWEVER, when i specify TEXT the darn thing creates MEMO fields?!? Qua Pasa?

Does anybody know how to change this so that I get proper text fields?
BTW: arrFileLayout(y, 6) contains the field type (=TEXT)
BTW2: I also used the actual word TEXT.

TIA,

Sander

Sub CreateTableX1(ByRef arrFileLayout())
Dim dbs As ADODB.Connection ' Database
Dim y As Integer
Dim strCreateTable As String
Dim strCreate As String
Dim strFields As String

Set dbs = CurrentProject.Connection()
' Create a table with two text fields.
strCreate = "CREATE TABLE ThisTable "
For y = 0 To UBound(arrFileLayout, 1)
'Debug.Print (arrFileLayout(y, 0))
strFields = strFields & arrFileLayout(y, 0) & arrFileLayout(y, 6) & ","
Next y

'remove last ,
strFields = Mid(strFields, 1, Len(strFields) - 1)
Debug.Print strFields

'Build sql
strCreateTable = strCreate & "(" & strFields & ")"
Debug.Print strCreateTable

'execute the blody thing
dbs.Execute strCreateTable

dbs.Close
End Sub






---------------------------------
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
Freeserve AnyTime - HALF PRICE for the first 3 months - Save £7.50 a month 
www.freeserve.com/anytime
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

---------------------------------
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today


More information about the AccessD mailing list