japelweb 0 Newbie Poster

You need to add a Timer to you form and a Lable

Double click in the timer and it should up the code editor in the Timer Tick event.

In the Tick event you need to update the Lable.

Lable.text = Date.Now or there abouts..

Make sure the timer interval is set to 1 second, (timer is in milli seconds to it will be 1000)

Stick to it and all this will make sense soon.

JAPEL

japelweb 0 Newbie Poster

Have been working with the code and having lots of luck...

But one question, stopping access to pages directly and re-directing them to the login page is fine for me in the .aspx world but I have 2 pages that are htm. Can you please give me some pointers on how this is done...

Attached is the html page i want to stop access to unless they go through the login page...

This page was created out of access 2003 to update a table as I don't have the skills yet to write it in asp. Yes I know it is the easy way out but the goal out-ways the journy in this caes.

;)

japelweb 0 Newbie Poster

Thanks for your time it works great...

Will now look further at my SQL version and see if I have done a similar thing.

japelweb 0 Newbie Poster

Well, I need to ask what the error message says. If you could please provide that (more than saying an exception error), I think we can determine what the problem is.

What are the error message details.

I created a second lable box and sent ex to string and this was the result.

I am also building the SQL version to see how that goes.

Thanks for the help, am learning lots on this one...

System.Data.OleDb.OleDbException: Too few parameters. Expected 4. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at WebListSite.WebForm1.DBConnection(String strUserName, String strPassword) in C:\Documents and Settings\Jason Apel\My Documents\My Webs\WebListSite\AdminLogin.aspx.vb:line 89

japelweb 0 Newbie Poster

It's my bad. I didn't know that the params in the SP must match the params in .net page

Your example works perfect. Thanks again.

I'm having the same problem can you explain further I am a newbie

japelweb 0 Newbie Poster

First I am new to coding and db but working hard at learning.

The login page comes up fine and no bugs in the build bet...

In the below code I keep getting an exception error??? I have checked that the MDB and LDB files have R/W for the asp.net user but no luck.

The Error connecting to DB keeps comming up and the username and password are correct.

IIS 5.1
Access DB 2003
VS 2003

Any ideas would be great as the rest seems to be fine....

Thanks Heaps :confused:

' ||||| Create OleDb Data Reader
Dim objReader As OleDbDataReader
objReader = MyCmd.ExecuteReader(CommandBehavior.CloseConnection)
' ||||| Close the Reader and the Connection Closes with it

While objReader.Read()
If CStr(objReader.GetValue(0)) <> "1" Then
lblMessage.Text = "Invalid Login!"
Else
objReader.Close() ' ||||| Close the Connections & Reader
Return True
End If
End While
Catch ex As Exception
'lblMessage.Text = "Error Connecting to Database!"
Label1.Text = "Error Connecting to Database!"
End Try