PDA

Click to See Complete Forum and Search --> : OpenSchema Problem


leontro
Oct 31st, 2000, 02:11 PM
Hi there,

I am using a Access database and I want to retrieve the tables in a database except system tables, but some problem is arrising while the "filter" line is being executed. My code is written below;
'------------------------------------------------------
Option Explicit
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset

Private Sub Command1_Click()
Set rst = cnn.OpenSchema(adSchemaColumns)
rst.Filter = "NOT TABLE_NAME like 'Msys%'" 'Problem occurs
Set dbg.DataSource = rst
End Sub

Private Sub Form_Load()
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
With cnn
.Mode = adModeReadWrite
.CursorLocation = adUseClient
.Open "some_dns"
End With
End Sub
'------------------------------------------------------

any idea may help...

Thanks in advance

Nov 1st, 2000, 10:48 PM
Hi, try using "*Sys*" in ur filter. This has worked for me.

All the best...vijay

leontro
Nov 3rd, 2000, 05:45 AM
Thanks Gantibabu,

But it didn't work, It works with the

"TABLE_NAME like 'Msys%'"

when 'NOT' is included then err.number=3001 is generated

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

I hate this error because it is not so simple to debug, a lot of things may be source for this.

Any other ideas please.....

Thanks in advance...

paulw
Nov 3rd, 2000, 07:48 AM
How about "TABLE_NAME NOT like 'MSys*'"

Cheers,

Paul.

leontro
Nov 4th, 2000, 10:12 AM
Thanks paulw,

But it didn't work too, I tried it before

any other ideas please...