Dim strConnectionString As String = "Driver={SQL Server};Server=localhost;Database=db_name;Uid=sa;Pwd=;"
'*** Query ***'
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Set objRec = New ADODB.Recordset
strSQL = "SELECT * FROM.... "
Conn.ConnectionString = strConnectionString
Conn.Open
objRec.Open strSQL, Conn, 1, 3
'*** Execute ***'
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionString = strConnectionString
Conn.Open
strSQL = "INSERT INTO...."
Conn.Execute (strSQL)
If Err.Number <> 0 Then
Exit Function
End If
Conn.Close
ทำ Report อยู่ๆมันก็ Error คะ มันขึ้นข้อความบอกว่า ...Microsoft Visual Studio has encountered a problem and needs to close.
Send an error report to Microsoft
A report has been created that includes more information about the causes of this error. Submitting this report helps Microsoft improve Visual Studio...