|
-
Aug 6th, 2003, 12:57 PM
#1
Thread Starter
Addicted Member
where is the error???
I've got made a macro command with this code :
Sub AdoRefresh()
Dim rs As New ADODB.Recordset
Dim userentry As String
Dim strdtfrom As String
Dim strdtto As String
Dim sql1 As String
Dim intCount As Integer
intCount = 1
strdtfrom = "01/07/2003"
strdtto = "07/07/2003"
userentry = "247"
Worksheets("test").Range("A2:C2000").ClearContents
Dim Connect As String
sql1 = "SELECT DOCUMENTS.f_docnumber, DOCUMENTS.date as DateTime FROM DOCUMENTS WHERE date >= TO_DATE ('" + strdtfrom + "', 'DD/MM/RRRR') AND date < TO_DATE ('" + strdtto + "', 'DD/MM/RRRR') AND user = " + userentry + " ORDER BY date"
Connect = "Provider=MSDAORA;Password=pass;User ID=userid;Data Source=mydb"
rs.Open sql1, Connect
' Set header values for sheet 1.
With Worksheets("test").Rows(1)
.Font.Bold = True
.Cells(2, 1).Value = "RowNum"
.Cells(2, 2).Value = "Doc"
.Cells(2, 3).Value = "Date & Time"
.Cells(2, 4).Value = "Total Time"
End With
With rs
Do While Not .EOF
Sheets("test").Cells(intCount + 2, 2) = !f_docnumber
intCount = intCount + 1
.MoveNext
Loop
End With
End Sub
i got error(1004) on this line:
Sheets("test").Cells(intCount + 2, 2) = !f_docnumber
but i can't underestand why seems everything o.k.
any suggestions ?????
Last edited by alazarou; Aug 6th, 2003 at 01:51 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|