i got this!

Option Explicit
Public con As New ADODB.Connection
Public rsTally As New ADODB.Recordset

Public Sub Connect()
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Aianski\Desktop\Cliente ko\SGO_Tally.mdb;Persist Security Info=False"
rsTally.Open "select * from tbl_Tally ", con, 3, 2
End Sub

i think its right. but when i run it i get
"syntax error in FROM clause."

I CANT CONTINUE MY PROJECT. :(
HELP ME!!

do you have a conflicting table or anything else named rsTally or Connect?

It sounds like rsTally or Connect is a reserved word.. presumably because there is a function with the same name (so there is confusion in working out whether you meant the function, or the call?)

The ideal solution is what you have done... change the rsTally or Connect name and see if that works.

Try the following -

con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Aianski\Desktop\Cliente ko\SGO_Tally.mdb;Persist Security Info=False"

'First change the long path to -
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\SGO_Tally.mdb;Persist Security Info=False" 'This will eliminate future install errors when installing your application on a users pc, GIVEN the fact that the database do exist in your application path!!!

rsTally.Open "select * from tbl_Tally ", con, 3, 2

'Change to -
rsTally.Open "select * from [tbl_Tally] ", con, 3, 2 'Using enclosed brackets
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.