Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to run the following code and I get an error with the following
details: Runtime Error -2147467259 Automation Error Unspecified Error The code looks like the following Dim wrkRange As Range Dim last As Integer Dim i As Integer Dim MyConn As ADODB.Connection Dim strConn As String Dim rstDocs As ADODB.Recordset Sub ParseContent() 'Get the working Range Set wrkRange = Application.InputBox("Enter the active range", "Range Selector", , , , , , 8) 'Find the last cell number last = wrkRange.Rows.Count 'Opening Database File 'Dim MyConn As New ADODB.Connection 'Dim strConn As String Set MyConn = New ADODB.Connection strConn = "Provider=SQLOLEDB;Server=Cronos;" & _ "Database=Papyrus;Integrated Security='SSPI';" MyConn.Open strConn 'Dim rstDocs As ADODB.Recordset Set rstDocs = New ADODB.Recordset rstDocs.Open "Docs", MyConn, adOpenKeyset, adLockOptimistic, adCmdTable 'Start Filling the access database 'Columns A+B to Docs Table For i = 1 To last Dim strfield As String strfield = wrkRange.Cells(i, "A") rstDocs.MoveLast rstDocs.AddNew Key_Id, strfield rstDocs.Update Next i End Sub Any ideas? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
aauugghhh...#div/o problems & various average formula problems | Excel Worksheet Functions | |||
Problems using Excel 2000 to open/save file saved in Excel 2003 | Excel Discussion (Misc queries) | |||
2 problems in excel | Excel Discussion (Misc queries) | |||
Problems with vb in excel | Excel Programming | |||
Problems merging an excel file due to code or file problems? | Excel Programming |