עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

חיבור למסד נתונים MySQL הנמצא באינטרנט דרך ASP

Featured Replies

פורסם

שלום,

מה הקונקשן סטרינג שאני רושם על מנת להתחבר לשרתי MySQL ?

פורסם

אתה לא חושב שגוגל יתן לך תשובה מספיק מפורטת לשאלה הבסיסית הנ"ל ?

בגדול ב-PHP זה:

mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db($DBName) or die("Unable to connect to database");

כשהמשתנים מוגדרים מראש כמובן:

$DBhost = "server";
$DBuser = "username";
$DBpass = "password";
$DBName = "database";

איך זה ב-ASP, תשאל את גוגל...

פורסם
  • מחבר

אוקיי, הצלחתי.

לכל מי שמחפש הנה הקוד:

קוד החיבור למסד הנתונים:


<%
Set Conn=Server.CreateObject("ADODB.Connection")   
Connstr =  "Driver={MySQL ODBC 3.51 Driver}; SERVER=שרת; DATABASE=שם מסד הנתונים; UID=משתמש; PWD=סיסמא;"
  Conn.Open connstr
%>

הפניה למסד הנתונים:



Dim sql,objRs

set objRs = server.CreateObject("ADODB.Recordset")
sql = "[tbl_Table]"
objRs.Open sql,Conn
Response.Write(objRs("שדה"))

שימו לב שאם אתם מריצים את הדף על ה IIS שלכם במחשב יש צורך להתקין את MyODBC מהקישור הבא:

http://dev.mysql.com/downloads/connector/odbc/3.51.html

שאלה נוספת בעניין:

אם אני מפרסם את האתר המכיל את הקוד הזה באמת מהאתרים הנותנים שרותי אכסון אתרים סביר להניח שיש להם את זה מותקן בשרת נכון ? ( במידה והוא תומך ב My SQL )

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.