Good morning,
I am not sure if this needs to go here or over in the SQL forum.
I have the following Stored Procedure:
I have an Access form with 2 unbound text boxes: StaffName, Password
What I would like to do is, trying to avoid SQL injections and increase security in the database, pass the login information from Access to SQL as securely as possible.
I cannot figure out the VBA to pass the parameter back to SQL and have the SP compare and return the information to me.
I am at a loss of what to do next.
This is what I have in Access so far:
I am getting an error message:
"Run-Time error '91':
Object variable or With block variable not set
Thank you all for any help you can give.
I am not sure if this needs to go here or over in the SQL forum.
I have the following Stored Procedure:
Code:
USE TestDB
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[getLogin]
@StaffName nvarchar(25), @Password nvarchar(25)
AS
BEGIN
SET NOCOUNT on;
SELECT * FROM dbo.vw_Staff where Staff=@StaffName and UserPass=@Password
End
I have an Access form with 2 unbound text boxes: StaffName, Password
What I would like to do is, trying to avoid SQL injections and increase security in the database, pass the login information from Access to SQL as securely as possible.
I cannot figure out the VBA to pass the parameter back to SQL and have the SP compare and return the information to me.
I am at a loss of what to do next.
This is what I have in Access so far:
Code:
Dim qdf As DAO.QueryDef, rst As DAO.Recordset
Dim StaffName As String
Dim Password As String
StaffName = Me.txtLogin
Password = Me.txtPassword
qdf.Connect = "ODBC;DSN=DBConn;Trusted_Connection=Yes;DATABASE=TestDB"
I am getting an error message:
"Run-Time error '91':
Object variable or With block variable not set
Thank you all for any help you can give.