Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADOX, Error "type is invalid", what is the problem?

Status
Not open for further replies.

ishmael33

Programmer
Jul 1, 2003
3
0
0
SV
Hi people, I´m have to create a table every month in my app, this table register some transactions month by month, the name is: month+year,ok, my problem is in the sentence:

cat.Tables.Append tblnueva I obtain the error "type is invalid", why is that? what is my error?. Thanks everybody.


Function newtable()
Dim xmes As String
Dim xaño As String
Dim newnombre As String

Dim cat As ADOX.Catalog
Dim tblnueva As ADOX.Table


xmes = Str(Month(Now))
xaño = Mid(Str(Year(Now)), 4)

newnombre = Trim(xmes & xaño)

Set cat = New ADOX.Catalog
setcon
cat.ActiveConnection = glo.cnBudget
Set tblnueva = New ADOX.Table

With tblnueva
Set .ParentCatalog = cat
.Name = newnombre
.Columns.Append "id", adInteger
!id.Properties("AutoIncrement") = True
.Columns.Append "dese", adVarChar, 80
.Columns.Append "mone", adCurrency
.Columns.Append "fecven", adDate
.Columns.Append "canc", adBoolean
.Keys.Append "id", adKeyPrimary, "id"
End With
cat.Tables.Append tblnueva
cat.ActiveConnection.Close
Set cat = Nothing


End Function
 

Change this:
.Columns.Append "dese", adVarChar, 80
to this:
.Columns.Append "dese", adVarWChar, 80

and you haven't responded to the last help you received in the previous thread...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top