![]() ![]() But this code works with using the Adaptive Server Enterprise Driver and I did use LankyMart’s advice with turning connection pooling off. Now if you ask me if its Database specific, I would not know. So here is the finished code edit that works.ĬonnectionString = "Driver=Adaptive Server Enterprise UserID=Admin Password=Pass Pooling=False" Reconnecting an then re-opening MyRecordSet led to the same error. The status went back to 0 and when you attempted to re-open MyRecordSet, it would fail with a broken object. The issue happened when MyRecordSet was being closed. ![]() So after much testing of different ideas, I finally got the code to work. Is there any way to run another query on the same connection to the database without running into theĮdit after suggested changes, still have the same error.ĭim M圜onnection, MyExcel, MyExcelBook, MyExcelSheet SQL = "Select * From Table Where Type=" & Parameter1 & " AND Color=" & Parameter2 & " " Parameter2 = MyExcelSheet.Cells(I,7).Value Parameter1 = MyExcelSheet.Cells(I,6).Value Set MyRecordSet = CreateObject("ADODB.RecordSet")ĭo while MyExcelSheet.Cells(I,2).Value "" ![]() Set M圜onnection = CreateObject("ADODB.Connection") Set MyExcelSheet = MyExcelBook.WorkSheets(2) Set MyExcel = CreateObject("Excel.Application") Dim M圜onnection, MyRecordSet, MyExcel, MyExcelBook, MyExcelSheetĭim ConnectionString, Parameter1, Parameter2, SQL, IĬonnectionString = "Driver=ODBC Driver UserID=Admin Password=Pass "
0 Comments
Leave a Reply. |