ممكن تساعدوني


(system) #1

[CENTER]اهلا بيكو اخواني واخواتي في المنتدي

اولا احب اوضحكل مدي اعجباي بالمنتدي ده

حقيقي بارك الله فيكم

وجزاكم الله كل خير

مش عايزة اطول عليكو بس انا ليا طلب صغير لو ممكن حد يساعدني انا بعمل

مشروع بالفيجوال بيسك وقابلتني مشكلتين

اول مشكله وانا بربط الداتا باس انا عاملاها بالاكسس

وعندي خطا في الكود مش عارفه اصححه ممكن حد يساعدني

ده الكود
[/center]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim X As String = "PROVIDER=MICROSOST.JET.OLE.4.O;DATASOURCE=C:\Documents and Settings\hoom\My Documents\R"
CN = New OleDbConnection(X)
CN.Open()
AD =
New OleDbDataAdapter(“SELECT*FROM R”, CN)
AD.Fill(DS,
“R”)
End Sub
[CENTER]
تاني مشكله انا عايزة اعمل set up للمشورع ومش عارفه اعمله

معلش انا كترت عليكو سامحوني

انا في انتظار ردكم ولكم جزيل الشكر
[/center]


(requinham) #2

[LEFT]you have many mistakes

firstly give me the version of VB

then

Dim X AsString = “PROVIDER=MICROSOST.JET.OLE.4.O;DATASOURCE=C:\Docu ments and Settings\hoom\My Documents\R”

must be replaced with

dim x as string="Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:\Docu ments and Settings\hoom\My Documents\R"

[/left]


(requinham) #3

this is an exple

[SIZE=2][COLOR=#0000ff][FONT=Courier New] Imports[/font][/color][/size][SIZE=2][FONT=Courier New][COLOR=#0000ff]  System[/color][/font][/size]
 [SIZE=2][COLOR=#0000ff] [/color][/size][SIZE=2][COLOR=#0000ff][FONT=Courier New] Imports[/font][/color][/size][SIZE=2][FONT=Courier New][COLOR=#0000ff]  System.Data[/color][/font][/size]
 [SIZE=2][COLOR=#0000ff] [/color][/size][SIZE=2][COLOR=#0000ff][FONT=Courier New] Imports[/font][/color][/size][SIZE=2][FONT=Courier New][COLOR=#0000ff]  System.Data.OleDb[/color][/font][/size]
 [SIZE=2][COLOR=#0000ff] [/color][/size][SIZE=2][COLOR=#0000ff][FONT=Courier New] Imports[/font][/color][/size][SIZE=2][FONT=Courier New][COLOR=#0000ff]  Microsoft.VisualBasic[/color][/font][/size]
 [SIZE=2][COLOR=#0000ff] [/color][/size][SIZE=2][COLOR=#0000ff][FONT=Courier New] Public[/font][/color][/size][FONT=Courier New][SIZE=2][COLOR=#0000ff] [/color][/size][SIZE=2][COLOR=#0000ff] Class[/color][/size][/font][SIZE=2][FONT=Courier New][COLOR=#0000ff]  Form1[/color][/font][/size]
  [FONT=Courier New][SIZE=2][COLOR=#0000ff] Inherits[/color][/size][/font][SIZE=2][FONT=Courier New][COLOR=#0000ff]  System.Windows.Forms.Form[/color][/font][/size]
  [FONT=Courier New] [SIZE=2][COLOR=#0000ff]Private[/color][/size][SIZE=2][COLOR=#0000ff] [/color][/size][SIZE=2][COLOR=#0000ff]Sub[/color][/size][SIZE=2][COLOR=#0000ff] Form1_Load([/color][/size][SIZE=2][COLOR=#0000ff]ByVal[/color][/size][SIZE=2][COLOR=#0000ff]  sender [/color][/size][SIZE=2][COLOR=#0000ff]As[/color][/size][SIZE=2][COLOR=#0000ff]  System.Object, [/color][/size][SIZE=2][COLOR=#0000ff]ByVal[/color][/size][SIZE=2][COLOR=#0000ff]  e [/color][/size][SIZE=2][COLOR=#0000ff]As[/color][/size][SIZE=2][COLOR=#0000ff]  System.EventArgs) [/color][/size][SIZE=2][COLOR=#0000ff]Handles[/color][/size][SIZE=2][COLOR=#0000ff] [/color][/size][SIZE=2][COLOR=#0000ff] MyBase[/color][/size][/font][SIZE=2][FONT=Courier New][COLOR=#0000ff].Load[/color][/font][/size]
  [FONT=Courier New] [SIZE=2][COLOR=#0000ff]Dim[/color][/size][SIZE=2][COLOR=#0000ff]  MyConnexion [/color][/size][SIZE=2][COLOR=#0000ff]As[/color][/size][SIZE=2][COLOR=#0000ff]  OleDbConnection = [/color][/size][SIZE=2][COLOR=#0000ff] New[/color][/size][/font][SIZE=2][FONT=Courier New][COLOR=#0000ff]  OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & _[/color][/font][/size]
   [SIZE=2][FONT=Courier New][COLOR=#0000ff] "C:\consultation.mdb")[/color][/font][/size]
 [FONT=Courier New] [SIZE=2][COLOR=#0000ff]Dim[/color][/size][SIZE=2][COLOR=#0000ff]  Mycommand [/color][/size][SIZE=2][COLOR=#0000ff] As[/color][/size][/font][SIZE=2][FONT=Courier New][COLOR=#0000ff]  OleDbCommand = MyConnexion.CreateCommand()[/color][/font][/size]
   [SIZE=2][FONT=Courier New][COLOR=#0000ff] Mycommand.CommandText = "SELECT NOM FROM QUESTIONS"[/color][/font][/size]
   [SIZE=2][FONT=Courier New][COLOR=#0000ff] MyConnexion.Open()[/color][/font][/size]
 [FONT=Courier New] [SIZE=2][COLOR=#0000ff]Dim[/color][/size][SIZE=2][COLOR=#0000ff]  myReader [/color][/size][SIZE=2][COLOR=#0000ff] As[/color][/size][/font][SIZE=2][FONT=Courier New][COLOR=#0000ff]  OleDbDataReader = Mycommand.ExecuteReader()[/color][/font][/size]
 [FONT=Courier New] [SIZE=2][COLOR=#0000ff]Do[/color][/size][SIZE=2][COLOR=#0000ff] [/color][/size][SIZE=2][COLOR=#0000ff] While[/color][/size][/font][SIZE=2][FONT=Courier New][COLOR=#0000ff]  myReader.Read()[/color][/font][/size]
   [SIZE=2][FONT=Courier New][COLOR=#0000ff] ListBox1.Items.Add(myReader.GetString(0))[/color][/font][/size]
  [FONT=Courier New][SIZE=2][COLOR=#0000ff] Loop[/color][/size][/font]
 [SIZE=2] [/size]  [SIZE=2][FONT=Courier New][COLOR=#0000ff]myReader.Close()[/color][/font][/size]
   [SIZE=2][FONT=Courier New][COLOR=#0000ff] MyConnexion.Close()[/color][/font][/size]
 [FONT=Courier New] [SIZE=2][COLOR=#0000ff]End[/color][/size][SIZE=2][COLOR=#0000ff] [/color][/size][/font][SIZE=2][COLOR=#0000ff][FONT=Courier New] Sub[/font][/color][/size]
 [SIZE=2][COLOR=#0000ff][FONT=Courier New] End[/font][/color][/size][FONT=Courier New][SIZE=2][COLOR=#0000ff] [/color][/size][/font][SIZE=2][COLOR=#0000ff][FONT=Courier New] Class[/font][/color][/size]