Here's my code
Public Function konek(k As String) As ADODB.Recordset
Dim con As New ADODB.Connection
con.Provider = "Microsoft.ACE.OLEDB.12.0"
con.ConnectionString = App.Path + "\dbBasketball2.accdb"
con.Open
Set konek = New ADODB.Recordset
konek.LockType = adLockOptimistic
konek.CursorType = adOpenKeyset
konek.Open k, con, adLockOptimistic
End Function
Private Sub Form_Load()
Set rs = konek("select * from tblPlayerstats where SeasonID = '" & fhcontrol.Label6.Caption & "' and GameID = '" & fhcontrol.Label5.Caption & "' and TeamID = '" & fhcontrol.Label4.Caption & "' and Active = '" & fhcontrol.lblactive1.Caption & "' and Order = '" & fhcontrol.lblorder1.Caption & "' ")
Label41.Caption = rs!Fname
Set rs = Nothing
End Sub
The error says:
Run-time error '-2147217900 (80040e14):
Syntax error (missing operator) in query expression 'SeasonID =
'seasonid' and GameID = 'Game001' and TeamID = 'Team001' and Active = '1' and '.
Thats it, and I cant see where or what is the problem,
Or... My database just sucks? really not good at normalizing either

New Topic/Question
Reply



MultiQuote




|