Avatar billede viking_sk Nybegynder
27. juli 2003 - 03:54 Der er 3 kommentarer

Username and PIN

Hello
I´m using FrontPage and then I have made the form with two fields ID and PW. I have sent the results to the file were is the code for comparig the ID ad PW:But how can I tell to the code that it has to go exactly to my database. Also when I had publish the page and the confirmation page was the same as the page what I have sent the results to (  hopefully that was right)it told me that Server can not run the Front Page blablabla... Help me please with this database - I´m going crazy of it....
Avatar billede eagleeye Praktikant
27. juli 2003 - 10:31 #1
To access your database you need a connection object and a connectionstring so the connection object can finde the databasen.

'Example for access database.:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\inetpub\wwwroot\mydb.mdb"

For other types of connection take at look here:
http://www.connectionstrings.com


To verify ID and PW you can create a SQL statement:

ID = Request.Form("ID")
PW = Request.Form("PW")
SQL = "SELECT * FROM tablename WHERE ID_FIELD = '" & id & "' AND PW_FIELD = '" & pw & "'"
Set rs = Conn.Execute(SQL)
if not (rs.EOF or rs.BOF) then
  'The user is in the database

else
  'Unknow user not match found for ID and PW

end if
Conn.Close
Set conn=nothing
Avatar billede nanosoft00 Nybegynder
28. juli 2003 - 13:05 #2
remember to replace:
ID = Replace(Request.Form("ID"),"'","''")
PW = Replace(Request.Form("PW"),"'","''")

otherwise your login will be unsecure
Avatar billede eagleeye Praktikant
28. december 2003 - 23:47 #3
hallo viking_sk sker her snart noget?
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester