Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / April 2006



Tip: Looking for answers? Try searching our database.

I cant set validation for existing Username when submit a registration form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Wu - 24 Apr 2006 13:51 GMT
<%

strODBC = "DSN=mysql_dsn; UID=root; PWD=;"

dim nama, syarikat, alamat1, alamat2
dim zip, negeri, negera, telefonP
dim telefonB, fax, emel, id
dim katalaluan1, sta, soalan, jawapan

nama = request.form("dNa")
syarikat = request.form("dSy")
alamat1 = request.form("dA1")
alamat2 = request.form("dA2")
zip = request.form("dZip")
bandar = request.form("dBand")
negeri = request.form("dNe")
negara = request.form("dNeg")
telefonP = request.form("dTP")
telefonB = request.form("dTB")
fax = request.form("dF")
emel = request.form("dE")
id = request.form("dNId")
katalaluan1 = request.form("dKat1")
sta = request.form("status")
soalan = request.form("dSoa")
jawapan = request.form("dJa")

Dim Objrs
    Set Objrs = Server.CreateObject("ADODB.Recordset")

Dim Strsql
    Strsql = "SELECT * FROM pendaftaran WHERE dNId = '" & id & "'"
    Objrs.Open Strsql, strODBC, 1, 3

   If Objrs.eof then   
     Set Objrs = Nothing
     Set strODBC = Nothing
     Response.redirect"Pendaftaran.asp?Message=!! Minta Maaf...Nama Id
Anda Telah Didaftar Oleh Ahli Lain!!"           

    Else

        Objrs.AddNew
            Objrs("dNa") = nama
            Objrs("dSy") = syarikat
            Objrs("dA1") = alamat1
            Objrs("dA2") = alamat2
            Objrs("dZip") = zip
            Objrs("dBand") = bandar
            Objrs("dNe") = negeri
            Objrs("dNeg") = negara
            Objrs("dTP") = telefonP
            Objrs("dTB") = telefonB
            Objrs("dF") = fax
            Objrs("dE") = emel
            Objrs("dNId") = id
            Objrs("dKat1") = katalaluan1
            Objrs("status") = stat
           Objrs("dSoa") = soalan
            Objrs("dJa") = jawapan           
        Objrs.Update
        ' ::::: Removing Recordset & Connection Object
        Set Objrs = Nothing
        Set strODBC = Nothing
    Response.redirect"MainPage.asp?Message=Anda telah berjaya daftar diri
sebagai ahli"
   
    End If
   
%>
Mike Brind - 24 Apr 2006 14:07 GMT
> <%
>
> strODBC = "DSN=mysql_dsn; UID=root; PWD=;"

Don't use system DSNs.  See http://www.aspfaq.com/show.asp?id=2126

<snip>

> Dim Strsql
>     Strsql = "SELECT * FROM pendaftaran WHERE dNId = '" & id & "'"
>     Objrs.Open Strsql, strODBC, 1, 3

Don't Select *.  You only need to select one field to serve your
purpose here.

>     If Objrs.eof then
>      Set Objrs = Nothing
[quoted text clipped - 5 lines]
>
>         Objrs.AddNew

Don't use AddNew.  See http://www.aspfaq.com/show.asp?id=2191

You haven't created or opened a connection object.  You're the second
one today.  Are you from the same class as this person?

http://groups.google.co.uk/group/microsoft.public.inetserver.asp.db/browse_frm/t
hread/40325302a02c5d7a/1ac9018fe7ce6163?hl=en#1ac9018fe7ce6163


--
Mike Brind
Chris Wu - 25 Apr 2006 05:31 GMT
Good morning,sir

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[TCX][MyODBC]Access denied for user: 'kokseng@kokseng' (Using password:
YES)

I still error even i already correct all my wrong syntax just now.
How?pls give some tips!!!!Thanks you
Mike Brind - 25 Apr 2006 08:24 GMT
> Good morning,sir
>
[quoted text clipped - 7 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***

What database are you using? MySQL?

--
Mike Brind
Chris Wu - 25 Apr 2006 08:59 GMT
Thanks for reply my question.I use MySQL database but i already fix my
problem.So sorry about inform you late anyway thank you very much..But
now i have another problem which i just posted it up..Hope you can help
me to fix that problem and finish my project and also increase my
knowlwdge in ASP,web programming language..Thank you again!!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.