ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

مشكل در دستور update

 
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET
View previous topic :: View next topic  
Author Message
hanan
مهمون يكي دو روزه


Joined: 15 Apr 2007
Posts: 14

PostPosted: Mon Aug 20, 2007 11:41 am    Post subject: مشكل در دستور update Reply with quote

سلام
من اين كد را براي دستور update مر بوط به پايگاه داده sql server در vb نوشتم ولي اين خطا را ميده
ممنون ميشم هر چه سريعنر راهنمايي كنيد
Incoorid syntax near “(“.


كد برنامه
Private Sub Command4_Click()
Dim cmd As New ADODB.Command
With cmd
.ActiveConnection = Adodc1.ConnectionString
.CommandType = adCmdText
.CommandText = " update tblstudent SET (ID_Number,name,family,age,madrak) =
( ,CStr(Val(Text1)), CStr(Text2), CStr(Text3),CStr(Text4), CStr(Text5))"
.Execute
Adodc1.Refresh
End With
End Sub
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3005
Location: Tehran

PostPosted: Mon Aug 20, 2007 9:42 pm    Post subject: Reply with quote

فقط جاي access اطلاعات ارتباط با sqlserver ‌رو بنويس :
Public cnn As New adodb.Connection
 With myAdodc
    .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Persist Security Info=False;Data Source=ParsX.mdb" & _
      ";Jet OLEDB:Database Password=" & Password & ";" & " Mode=Read"
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
    .CommandType = adCmdText
    .RecordSource = "SELECT CourseCode As ' ßÏ ÏÑÓ ', CourseName As ' äÇã ÏÑÓ ', " & _
      "VahedNazari As ' æÇÍÏ äÙÑí ', VahedAmali As ' æÇÍÏ Úãáí ', " & _
      "CourseTerm As ' ÊÑã ', NumZang As ' ÊÚÏÇÏ Òä ', " & _
      "Name As ' ãÞØÚ '  from tblCourseInfo,tblMaghtaInfo where " & _
      " CourseMaghta=tblMaghtaInfo.ID order by CourseCode,CourseName "
    .Refresh
 End With
     cnn.Execute ("Update tblCourseInfo set CourseCode='" & _
        txtCourseCode.Text & "', CourseName = '" & _
        txtCourseName.Text & "', " & strVahedKind & "= " & txtVahedNum.Text & _
        ", CourseTerm = " & txtTerm.Text & ", NumZang=" & _
        txtZang.Text & ", CourseMaghta= " & cmbMaghta.ListIndex & _
        " Where CourseCode='" & strPubCourseCode & "'")
        DoEvents
        Call MsgBox("ÊÛííÑÇÊ ÇÚãÇá ÔÏ", vbOKOnly, "ÊæÌå")
        myAdodc.Refresh
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum