Hi,
After linking the table to access 2007, problems with my forms started! example code:
Code:
Private Sub Form_Load()
MsgBox theactive
Set dbs = CurrentDb
strSQL = "SELECT * FROM dbo_users_login where isactive = " & theactive & ""
Set rsSQL = dbs.OpenRecordset(strSQL)
MsgBox rsSQL.RecordCount
logintxt.Caption = rsSQL.Fields![FullName]
lbl60.Caption = "Logged in as " & rsSQL.Fields![usermenu]
If theactive = 0 Then
test = MsgBox("You can view the menu after login", vbExclamation)
DoCmd.Close acForm, "mainmenu", acSaveYes
Else
If rsSQL.Fields![usermenu] = "Admin" Then
NavigationButton11.Enabled = True
Else
NavigationButton11.Enabled = False
End If
Set dbs1 = CurrentDb
strSQL1 = "SELECT * FROM logfile"
Set rssql1 = dbs.OpenRecordset(strSQL1)
rssql1.AddNew
rssql1.Fields![FullName] = rsSQL.Fields![FullName]
rssql1.Fields![UserName] = rsSQL.Fields![UserName]
rssql1.Fields![thedate] = Date
rssql1.Fields![login_time] = Time
rssql1.Update
End If
End Sub
this code was working fine when the tables were in MS Access and created with MS Access. after moving the tables to SQL server 2008 r2 express then deleting the tables from Access 2007. I linked the table from SQL server 2008 r2 express to Access 2007 leaving the forms (from before). when trying the login form i did succeeded after only change the table name from "users_login" in the old database to "dbo_users_login" in the new linked table.
the main menu form though, i tried changing the table name (same table) to the same i did above from "users_login" in the old database to "dbo_users_login" in the new linked table but it tells me no records!
please help about this. is there an other way to deal with linked tables!
thanks,
Rami