הכותרת עברה עריכה לאחרונה בתאריך 16.09.02 בשעה 23:40 על-ידי מנהל
לפורום מדריכים ואני מקווה לקבל גישה לשמה על זה עבדתי קשה מאוד
..טוב אני רשמתי לבד את המדריך הזה סליחה אם יש טעויות אני לא מושלם
=]
אז ככה כדי לעשות מסד נתונים באקסס צריכים מספר דברים
1 - אקסס כמובן
2 - תוכנה שנמצאת אצל רובם בקונטרול פאנל ODBC
3 - ו PWS or IIS תלוי בוינדוס
יש את זה בדיסק של הווינדוס אוקי אז ככה
במסד הזה נשים רשימת חברים
שם פרטי שם משפחה ת"ז ציון עיר שכונה זכר או נקבה קודם כל
ניצור קובץ אקסס
בתוכו נפתח טבלה בשם database
שמה נשים את העמודות הבאות
pname,fname,id,city,nieghborhood,sex,vot
לפי הסדר הזה
נשמור את הקובץ בשם
database.mdb
כעת נפתח מסמך חדש של notepad
ובתוכו נשים את הקוד הבא
p11
-- <% function checkString(strInput) strTemp=Replace(strInput,"'","`") checkString=strTemp end function pn=checkString(Request.Form("pname")) fn=checkString(Request.Form("fname")) i=Request.Form("id") ci=checkString(Request.Form("city")) niegh=checkString(Request.Form("nieghborhood")) se=Request.Form("sex") vo=Request.form("vot")Set Conn = Server.CreateObject("ADODB.Connection") conn.open "DSN=MyDsn" SQLstmt = "INSERT INTO data (pname,fname,id,city,nieghborhood,sex,vot) VALUES('" ','"+fn+"','"+i+"','"+ci+"','"+niegh+"' ,'"+se+"','"+vo+"')" response.write "The sql query : " & SQLstmt 'Response.Write"<br><br>" conn.Execute(SQLstmt) conn.Close set c=nothing response.write "<html>" & vbCrLf response.write "<head>" & vbCrLf response.write "<meta http-equiv=""Refresh"" content=""1; url=פה נשים את השם של הקובץ שאנחנו רוצים שזה יחזור אליו אוטומטית"">" & vbCrLf response.write "</head>" & vbCrLf response.write "<body bgcolor=lightsteelblue>" & vbCrLf response.write "<DIV align=center>"& vbCrLf response.write "<font size=10>"& vbCrLf response.write "הטופס נשלח בהצלחה תודה " & vbCrLf response.write "</body>" & vbCrLf response.write "</html>" & vbCrLf %> --
|
p22
נשמור את הקובץ בשם ADD.asp
אחרי שעשינו את זה ניצור טופס מתאים בשבילו
בשביל זה נפתח מסמך notepad חדש
ונשים פה טופס ושכל אחד יעצב לעצמו
הנה הקוד
p11
- <script language="JavaScript"> iderror1=" נא למלא שם פרטי" iderror2=" נא למלא שם משפחה"; iderror3=" למלא מספר תעודת זהות"; iderror4=" נא למלאת שם העיר" iderror5=" נא למלא את שם השכונה" iderror6=" אסור לשלב ספרות בתוך שם" iderror7=" מספר תעודת זהות אינו נכון נא למלא שוב" iderror9=" לא ניתן לשלב אותיות או סימנים בתוך מספר תעודת זהות" function newalert(errorstring) { alert(errorstring); } function checkOk(st) { var allValid = true; for (i = 0; i <st.length; i++) { ch = st.charAt(i); if ((ch >=0)&&(ch >=9)) { allValid = false; break; } } return allValid; } function testForm(theForm) { if (theForm.pname.value == "") { theForm.pname.focus(); newalert(iderror1); return (false); } if (theForm.fname.value == "") { theForm.fname.focus(); newalert(iderror2); return (false); } if (theForm.id.value == "") { theForm.id.focus(); newalert(iderror3); return (false); } if (theForm.nieghborhood.value == "") { theForm.nieghborhood.focus(); newalert(iderror5); return (false); } if (theForm.city.value == "") { theForm.city.focus(); newalert(iderror4); return (false); } if (theForm.id.value.length != 9) { theForm.id.focus(); newalert(iderror7); return (false); } var st = theForm.pname.value; if (!checkOk(st)) { theForm.pname.focus(); newalert(iderror6); return (false); } var st = theForm.fname.value; if (!checkOk(st)) { theForm.fname.focus(); newalert(iderror6); return (false); } return true; } </script> <html> <head> <title>רשימת חברים</title> <div align=center> <b><u></u></b> </font> </div> <head> <center> <body bgcolor=#003366> <form action=add.asp method=post name=votform onsubmit="return testForm(this)"> <tr> <td align=right><input name=pname type=text size=10> <td align=right> <font face=tahoma size=2 color=white> שם פרטי </font> </td> </td> </tr> <tr> <td align=right><input name=fname type=text size=15> <td align=right> <font face=tahoma size=2 color=white> שם משפחה </font> </td> </td> </tr> <tr> <td align=right><input name=id type=text size=15> <td align=right> <font face=tahoma size=2 color=white> ת"ז </font> </td> </td> </tr> <tr> <td align=right> <select name="vot"> <option value="none" > -בחר-</option> <option value="garua" > גרוע </option> <option value="savir" > סביר </option> <option value="tov" > טוב </option> </select> <td align=right> <font face=tahoma size=2 color=white> ציון * </font> </td> </td> </tr> <tr> <td align=right><input name=city type= size=15> <td align=right> <font face=tahoma size=2 color=white> עיר * </tr> <tr> <td align=right><input name=nieghborhood type= size=15> <td align=right> <font face=tahoma size=2 color=white> שכונה </tr> <tr align=center> <td> </td><td> </td> <td><input type=submit value=שלח></td> <td><input type=reset value=אפס></td> <td><input type=radio name=sex value=m checked> זכר</td> <td><input type=radio name=sex value=f> נקבה</td> </tr> </form> </body> </html> ----
|
p22
עכשיו נשמור את זזה בשם
p11
p22
ואז נשים את שלושת הקבצים
p11
add.asp database.html datebase.mdb
|
p22
בתקייה של pws or iis
ואז נלך אל
p11
start -> settings -> control panel -> נפעיל את ODBC
p22
בתוכו נלחץ על System DSN
ו ADD
נבחר את
p11
microsoft access driver (mdb)
p22
ב data sorce name נרשום MySql
ונלחץ select ונבחר בקובץ אקסס שעשינו
database.mdb
נפעיל ת PWS
נכנס דרך
p11
http://10.0.0.127/database.html
p22
וזה אמור לפעול=]
תהנו
כל הזכויות שמורות לי=] אל תעתיקו=] תביאו תגובות