PLEASE!!- Need help Copying Tables / ADOX 
Author Message
 PLEASE!!- Need help Copying Tables / ADOX

I'm using  Microsoft Access 2000 and VB6

I am successfully using ADOX to copy what DB and
the tables that I need in my project.  However, there is
one setting that does NOT copy...

In my original DB, many fields in my Tables have the
setting  "Text" (which copies fine)  and the further
distinctive setting of  "Allow Zero Length", which
allows zero-lenght strings to be OK in this field.
THIS SETTING IS CRITICAL TO ME IN MY
PROJECT, BUT IT WILL NOT COPY !!

I need to be able to copy the table (which could happen
as many as 9 times in my project) AND have it have
that setting  "Allow Zero Length"
How can I add this adjustment ??



Thu, 14 Jul 2005 21:35:24 GMT  
 PLEASE!!- Need help Copying Tables / ADOX
Not sure what way you use to copy the table, however, you can try the
following code to adjust the "Allow Zero Length" property.

Code snipped:

Private Sub Form_Load()

Dim conn As New ADOX.Catalog
Dim tbl As ADOX.Table
Dim p As ADOX.Property
Dim col As ADOX.Column

conn.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\Databases\sample.mdb;"

Set tbl = conn.Tables("Employees")
Set col = tbl.Columns("LastName")

For Each p In col.Properties

Debug.Print p.Name & ":" & p.Value

If p.Name = "Jet OLEDB:Allow Zero Length" Then
    p.Value = True
End If

Next

End Sub

Hope it helps.

Sincerely,

Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Newsgroups: microsoft.public.vb.controls
X-Tomcat-NG: microsoft.public.vb.controls

I'm using  Microsoft Access 2000 and VB6

I am successfully using ADOX to copy what DB and
the tables that I need in my project.  However, there is
one setting that does NOT copy...

In my original DB, many fields in my Tables have the
setting  "Text" (which copies fine)  and the further
distinctive setting of  "Allow Zero Length", which
allows zero-lenght strings to be OK in this field.
THIS SETTING IS CRITICAL TO ME IN MY
PROJECT, BUT IT WILL NOT COPY !!

I need to be able to copy the table (which could happen
as many as 9 times in my project) AND have it have
that setting  "Allow Zero Length"
How can I add this adjustment ??



Sat, 16 Jul 2005 19:29:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help Help Need to copy a field from one table into another table

2. Copy a Table using ADO or ADOX

3. Adox and copy table

4. Copying Tables with ADOX

5. need help please:joined tables,add new entries based on one table columns

6. need help please:joined tables,add new entries based on one table columns

7. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

8. Copying Individual Tables - Urgent Help needed

9. Help needed copying recordset contents to table

10. need help copying existing Access table with VB5

11. Need help in error checking and file copying please

12. Need help with FileSystem Copy Please!

 

 
Powered by phpBB® Forum Software