Results 1 to 5 of 5

Thread: ADO and Excel 2k[RESOLVED for now]

Threaded View

  1. #1

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    ADO and Excel 2k[RESOLVED for now]

    I am connecting to an Excel spreadsheet using ADO,
    but the resulting recordset only has values for the text cells
    and not any date or numeric cells. I don't see why the recordset
    is not picking up the cells other than text.

    Any ideas???

    Code:
    Dim sSQL As String
    Dim oRsE As ADODB.Recordset
    Dim oCnnE As New ADODB.Connection
    
    oCnnE.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; DATA Source=" 
    & frmMain.lblSVR_Path.Caption & ";Extended Properties=Excel 8.0;"
    oCnnE.Open
    
    sSQL = "SELECT"
    sSQL = sSQL & " *"
    sSQL = sSQL & " FROM"
    sSQL = sSQL & " [Worksheet]"
        
    Set oRsE = New ADODB.Recordset
    oRsE.Open sSQL, oCnnE, adOpenStatic, adLockReadOnly, adCmdText
    
    If IsDate(oRsE!F1) = True Then...
    The F1 Field contains several rows of dates and they all come in as Null.

    Thanks for any help.
    Last edited by RobDog888; Mar 20th, 2003 at 12:17 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
  •  



Click Here to Expand Forum to Full Width