objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("App_Data\inetds.mdb"))
strSQLQuery = "Select * from inetmem WHERE Loginnaam = '" & TbUsernaam.Text & "' And pw = '" & TbWachtwoord.Text & "'"
objConnection.Open()
objCommand = New OleDbCommand(strSQLQuery, objConnection)
objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
If objDataReader.Read() Then
test1 = objDataReader.GetName(1)
test2 = objDataReader.GetValue(2)
objConnection.Close()
----> Until here it works fine.
'--- now I want a select count
objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("App_Data\inetds.mdb"))
strSQLQuery = "Select count(*) as dscounter from inetds WHERE database = 'XXX' And corrnr = 1 "
objConnection.Open()
objCommand = New OleDbCommand(strSQLQuery, objConnection)
objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
Session(DSaantal) = objDataReader.Item("DScounter")
Response.Redirect("main.aspx")
Else
objConnection.Close()
Return
End If
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE