![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Ado Connection Error Hi! Im using this VB6 code and work fine. But When I plece it in my other project using VBScript, dont work fine and criate un error "Class not defined". Samme one helpe me? Set Cnn1 = New ADODB.Connection StrCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Supervisao\Alarmes.mdb;Persist Security Info=False" Cnn1.Open StrCnn Set RST = New ADODB.Recordset RST.CursorType = adOpenKeyset RST.LockType = adLockOptimistic RST.Open "Registos", Cnn1, , , adCmdTable If Not RST.BOF Then RST.MoveFirst End If RST.AddNew RST!Data = Date RST!Hora = Time RST!Equipamento = "Motor 1" RST!Alarme = "térmico" RST.Update |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Ado Connection Error "Henrique" <wq@xxxxxx> wrote in message news:newscache$4sps7k$dll$1@xxxxxx Quote: > Hi! > > Im using this VB6 code and work fine. But When I plece it in my other > project using VBScript, dont work fine and criate un error "Class not > defined". > > Samme one helpe me? > > Set Cnn1 = New ADODB.Connection > > StrCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data > Source=C:\Supervisao\Alarmes.mdb;Persist Security Info=False" > Cnn1.Open StrCnn > > Set RST = New ADODB.Recordset > RST.CursorType = adOpenKeyset > RST.LockType = adLockOptimistic > RST.Open "Registos", Cnn1, , , adCmdTable > > If Not RST.BOF Then > RST.MoveFirst > End If > > RST.AddNew > RST!Data = Date > RST!Hora = Time > RST!Equipamento = "Motor 1" > RST!Alarme = "térmico" > > RST.Update Set Cnn1 = New ADODB.Connection Set RST = New ADODB.Recordset with this: Set Cnn1 = CreateObject("ADODB.Connection") Set RST = CreateObject("ADODB.Recordset") Also, you must assign values to adCmdTable, adOpenKeyset, and adLockOptimistic with Const statements. Const adCmdTable = 2 Const adOpenKeyset = 1 Const adLockOptimistic = 3 -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Ado Connection Error Ok Work fine. Thank you "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> escreveu na mensagem news:uh$5CX9HJHA.1364@xxxxxx Quote: > > "Henrique" <wq@xxxxxx> wrote in message > news:newscache$4sps7k$dll$1@xxxxxx Quote: >> Hi! >> >> Im using this VB6 code and work fine. But When I plece it in my other >> project using VBScript, dont work fine and criate un error "Class not >> defined". >> >> Samme one helpe me? >> >> Set Cnn1 = New ADODB.Connection >> >> StrCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data >> Source=C:\Supervisao\Alarmes.mdb;Persist Security Info=False" >> Cnn1.Open StrCnn >> >> Set RST = New ADODB.Recordset >> RST.CursorType = adOpenKeyset >> RST.LockType = adLockOptimistic >> RST.Open "Registos", Cnn1, , , adCmdTable >> >> If Not RST.BOF Then >> RST.MoveFirst >> End If >> >> RST.AddNew >> RST!Data = Date >> RST!Hora = Time >> RST!Equipamento = "Motor 1" >> RST!Alarme = "térmico" >> >> RST.Update > Replace these two statements: > > Set Cnn1 = New ADODB.Connection > Set RST = New ADODB.Recordset > > with this: > > Set Cnn1 = CreateObject("ADODB.Connection") > Set RST = CreateObject("ADODB.Recordset") > > Also, you must assign values to adCmdTable, adOpenKeyset, and > adLockOptimistic with Const statements. > > Const adCmdTable = 2 > Const adOpenKeyset = 1 > Const adLockOptimistic = 3 > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Connection error - Virginmedia | Live Mail | |||
| connection error | Vista mail | |||
| VB.NET application cliick-once deployment via internet - Error - Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. | .NET General | |||
| all net connection 10013 error | Vista networking & sharing | |||
| Re: VPN Connection...failed. The error...is 734. | Vista networking & sharing | |||