我写了代码在打开窗体事件是否正确?
Dim rst5 As Recordset
Set rst5 = CurrentDb.OpenRecordset("SELECT * FROM 用户密码表 IN '' [ODBC;DSN=数据库名称;UID="用户名"WD=" 密码 ";DATABASE=数据库名称] where 用户名='"登陆窗体用户名"'", dbOpenDynaset, dbSeeChanges)
rst5.Edit
rst5.Update
rst5.Close
D oCmd.OpenForm "窗体"
还是这样?
Dim mySQLConnection As New ADODB.Recordset
mySQLConnection.Open "SELECT * FROM 用户表 IN '' [ODBC;DSN=ccc;UID=saWD=123456;DATABASE=数据库名称]", CurrentProject.Connection, adOpenForwardOnly
mySQLConnection.Close
Set mySQLConnection = Nothing