Syntax error

Hi guys: Can any one please help me in that error?  Thanks

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
Well, knowing what program you're using would be nice.

btw, the problem is that there are more libraries (see Tools/References) which have a Database or Recordset class defined. Thus

a) Use in VBA always the library name, thus DAO.Database or DAO.Recordset or DAO.TableDef..
b) Check your references whether you have added the appropriate library.

But I guess it's b).
I think it is better that you just make select * from the table then use the recordset fields().name

something like tablename, con
dim myArralist as String()
dim ii as integer
for ii = 1 to rs1.fields.count
myArralist .add rs1.fields(ii).Name

Open in new window

mustish1Author Commented:
got error
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

mustish1Author Commented:
i change it to prior version but still getting this error.

It looks like you are running code in an Access2003 (or earlier) database and trying to open an Access2007 (or later) database, which you can not do.
mustish1Author Commented:
i just create table in access 2010 and publish it in earlier version.
Is this a new Access 2010 database installation?
Is this a new PC or upgraded Windows OS?
mustish1Author Commented:
I installed it couple of year's ago its a 2010 on windows 7
Is this the first time you've opened this database in that environment?
mustish1Author Commented:
I open it multiple times.
I open it multiple times.
Did it worked properly those times?
mustish1Author Commented:

You are showing us a table.  Where would your code run in such a scenario?
mustish1Author Commented:
in vb6

Dim con As New Connection
'Without adding library of Microsoft ADO 2.0 Library
'The connection can not be come
Dim rs As New Recordset
Dim rs1 As New Recordset

Private Sub Form_Load()
Print GetSortedFieldNames("[table1]")
End Sub
Function GetSortedFieldNames(tablename As String) As Variant
With con
.Provider = "Microsoft.jet.OLEDB.3.51.provider"
.ConnectionString = App.Path & "\db1.mdb"
End With
rs1.Open "table1", con, adOpenKeyset, adLockOptimistic, adCmdTable

    Dim db As Database, td As TableDef, f As Field
    Set db = CurrentDb
    Set td = db.TableDefs(tablename)
    Set myArrayList = CreateObject("System.Collections.ArrayList")
    For Each f In td.Fields
        myArrayList.Add f.Name
    GetSortedFieldNames = Join(myArrayList.ToArray, ",")

End Function

Open in new window

Check your references.  I suspect that you will see a selected library that doesn't exist on your PC.
mustish1Author Commented:
Can you please tell me which one is missing?

Have you migrated to a 64-bit version of Windows?  The 32-bit versions of DLLs are in a SYSWOW sub folder.  I think your references are probably pointing to the 64-bit system folder.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mustish1Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.