• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 688
  • Last Modified:

MAS90 ODBC error - slash in table name

Hello,

I get a SQL Syntax error when I try to access a table with special character in its name. If I enclose it in square brackets, I get a different error for all tables - with or without special character in name. All tables can be accessed from MS Access.

MDAC 2.8
ODBC Driver Name: MAS 90 32-Bit ODBC Driver
Ver: 2.10.00.00
Company: ProvideX Technologies

Code:
            Set rs = New adodb.Recordset

            rs.Open tblName, con, adOpenStatic, adLockReadOnly, adCmdTable

Error: Syntax error

            rs.Open "[" & tblName & "]", con, adOpenStatic, adLockReadOnly, adCmdTable

Error: -2147217887 : ODBC driver does not support the requested properties

            If rs.Fields.count > 0 Then
                For i = 0 To rs.Fields.count - 1
                        list1.AddItem s
                Next i

                fldTable = tblName
            End If

Any solution?
0
vbdev04
Asked:
vbdev04
  • 6
  • 5
1 Solution
 
geotigerCommented:

Have you tried to put in single quote such as

Set tblName = "'" & tblName & "'"


GT
0
 
vbdev04Author Commented:

Nope that didn't work

Thanks,
0
 
MourdekaiCommented:
What is the name of the table you are trying to access?

Also, what is the connection string you are using for your recordset?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
vbdev04Author Commented:

I use DSN to access this table: SO1_S/OEntryHeade. There isn't any problem accessing other tables.

Thanks,




0
 
MourdekaiCommented:
My TRSG for Mas90 reports the table name as: SO1_SOEntryHeader, maybe give that a try instead?

What version of Mas90 do you have?
0
 
vbdev04Author Commented:

Let me try that.

Thanks,
0
 
vbdev04Author Commented:

Mourdekai,

Using table name without slash didnt work :(

Still hoping ...

Thanks,
0
 
MourdekaiCommented:
Try manually linking the table first like:

File -> Get External Data -> Link Tables...

Then select ODBC Databases from "files of type"

Then choose your Mas90 connection, and sign on if needed, then scroll through the list to find the table you want and link it.  Now what is the name that it gives to that table you just linked?  Try that one.
0
 
vbdev04Author Commented:

If I cant get the Mas90 ODBC driver to work directly with ADO, I will have to work with MS Access linked tables or pass-thru queries. But before that I want to see if I can get it to work directly without using Access as go between. It is likely that there isn't any direct access solution ...

So far I have tried:
 SO1_S/OEntryHeader
 [SO1_S/OEntryHeader]
 “SO1_S/OEntryHeader”
 ‘SO1_S/OEntryHeader’

Let me know if you have any other suggestions. Thanks for your help.

0
 
MourdekaiCommented:
I just meant to use Access to check out what the name of the table is.  Sorry for the confusion.
0
 
vbdev04Author Commented:

Success! Using double quotes worked. I am not sure why it didnt work the first time around.

Anyways thanks for all your help
0
 
MourdekaiCommented:
Sure thing, glad you got it working!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now