18-02-20, 03:35 PM
عدل الكود ليكود كالتالي :
-
PHP كود :
Sub AlterTableX1(field_row As ListBox)
Dim intLoop As Integer
Dim strSQL As String
Dim strSQL1 As String
Dim sReturn As String = ""
For intLoop = 0 To field_row.Items.Count - 1
Dim drSelectedItem As DataRowView = field_row.Items(intLoop)
sReturn = drSelectedItem.Item(0).ToString
strSQL = "ALTER TABLE Emp_Sal ADD " & _
sReturn & " LONG INTEGER"
ExcuteNoneQury(strSQL)
strSQL1 = "ALTER TABLE tbl_General ADD " & _
sReturn & " LONG INTEGER"
ExcuteNoneQury(strSQL1)
Next intLoop
MsgBox("تمت الإضافة بنجاح", MsgBoxStyle.Information, "البرنامج ")
End Sub
-
PHP كود :
Sub ExcuteNoneQury(strSQL As String)
Dim cn As New OleDb.OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\TBLCO.mdb")
Dim Cmd As New OleDb.OleDbCommand(strSQL, cn)
If cn.State = ConnectionState.Closed Then cn.Open()
Cmd.ExecuteReader()
If cn.State = ConnectionState.Open Then cn.Close()
End Sub
سبحان الله وبحمده سبحان الله العظيم و الحمد لله ولا اله الا الله والله اكبر
