0

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!!

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by AndreRet
0

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.

0

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

Edited by AndreRet: Code Brackets

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.