|
Hello, I have a type mismatch that is driving me mad. If anyone can help?
I am trying to place data in an excel spreadsheet from an SQL database but it will not work. The code is:
----------------------------------------------------------------
Dim ExcelSheet
Set ExcelSheet = CreateObject("Excel.Application")
ExcelSheet.Application.Workbooks.Open "/forum/cdocumentsprodprod_base1.xls"
' show to user?
ExcelSheet.Application.Visible = False
set conn=server.CreateObject("ADODB.Connection")
conn.Open "product", "sa", "******"
set RSPRE_Grid = conn.Execute("select * from RSPRE order by id")
set RSPRE_IND = conn.Execute("select * from product where STATUS = 'PREINDUCTION'")
RSPRE_Grid.MoveFirst
do until RSPRE_Grid.EOF or RSPRE_IND.EOF
row = RSPRE_Grid("SHEET_ROW")
column = RSPRE_Grid("SHEET_COLUMN")
ExcelSheet.ActiveSheet.Cells(column,row).Value = RSPRE_IND("ESN") & " - " & ucase(RSPRE_IND("CUSTOMER"))
RSPRE_IND.MoveNext
loop
---------------------------------------------------------------
RSPRE is a table in SQL that has rows and columns to place the data.
If anyone can advise me it would be appreciated.
|
|
|
|
|
|
|
|