السلام عليكم و رحمة الله و بركاته
سلسة الاخطاء لا تنتهي مع الاس بي مع ان انقلها كاملة من الانرنت او من كتاب لتعلم الاس بي
فأحيانا تنفذ بشكل صحيح و البعض لا
الان هذا كود باستخدام التعليمة SQL عن طريق الامر insert
المشكلة يظهر خطأ ان ليس صحيح
الحل ان كان لديكم كود مجرب لاضافة قواعد البيانات من الفورم الى قاعدة البيانات
وهنا الكود
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include virtual="/pagetop.txt"-->
<%
On Error Resume Next
p_userid = Request("p_name")
p_pass1 = Request("p_pass1")
p_pass2 = Request("p_pass2")
p_first = Request("p_first")
p_last = Request("p_last")
p_email = Request("p_email")
if p_pass1 = p_pass2 then
set outpostDB = server.createObject("ADODB.Connection")
outpostDB.open "outpost"
theSQL = "insert into members "
theSQL = theSQL & "(username, password, first_name, last_name, "
theSQL = theSQL & "email, believes_in_aliens)"
theSQL = theSQL & " values ('"&p_userid&"', '"&p_pass1&"', '"
theSQL = theSQL & p_first&"', '"&p_last&"', '"&p_email&"', '"
theSQL = theSQL & p_believes_in_aliens&"')"
outpostDB.Execute(theSQL)
for each p_medium in Request("p_medium")
theSQL = "insert into userid_medium (userid, medium) values ('"
theSQL = theSQL & p_userid&"', '"&p_medium&"')"
outpostDB.Execute(theSQL)
next
outpostDB.close
set outpostDB = Nothing
%>
<% if Err.number = 0 then
'All is well with the world %>
<H2>User Registration</H2>
Thank you for registering with Primary Outpost!
<% else %>
'There was a problem with their registration
<H2>Problem</H2>
There was a problem with your registration.
Please go back and choose a different username.
<% end if
else
'p_pass1 doesn't match p_pass2
%>
<H2>Password Error</H2>
Both entries for your password must match.
Please try again. Thank you!
<%
end if
%>
<!--#include virtual="/pagebottom.txt"-->
</BODY>
</HTML>


