ADODB.Fields error '800a0bb9' in asp

Discussion in 'ASP General' started by DC, Sep 10, 2003.

  1. DC

    DC Guest

    Im getting the error

    ADODB.Fields error '800a0bb9'

    Arguments are of the wrong type, are out of acceptable range, or are in
    conflict with one another.

    In the following script to copy and rename the latest file in a webcam
    folder. Any ideas why this is failing?

    <%
    Dim objFSO, rsFSO, objFolder, File, varFileName
    Set rsFSO = Server.CreateObject("ADODB.Recordset")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder("C:\Documents and
    Settings\Administrator\My Documents\My Pictures\ImageStudio\Album\Motion
    Images\")

    rsFSO.Fields.Append "Name", adVarChar, 200 -----Error occurs on
    this line.
    rsFSO.Fields.Append "Type", adVarChar, 200
    rsFSO.Fields.Append "DateCreated", adDate
    rsFSO.Fields.Append "DateLastAccessed", adDate
    rsFSO.Fields.Append "DateLastModified", adDate
    rsFSO.Fields.Append "Size", adInteger
    rsFSO.Fields.Append "TotalFileCount", adInteger
    rsFSO.Open

    For Each File In objFolder.Files
    'hide any file that begins with the character to exclude
    If (Left(File.Name, 1)) <> Exclude Then
    rsFSO.AddNew
    rsFSO("Name") = File.Name
    rsFSO("Type") = File.Type
    rsFSO("DateCreated") = File.DateCreated
    rsFSO("DateLastAccessed") = File.DateLastAccessed
    rsFSO("DateLastModified") = File.DateLastModified
    rsFSO("Size") = File.Size
    rsFSO.Update
    End If
    Next

    rsFSO.Sort = "DateLastModified"

    Set objFolder = Nothing
    rsFSO.MoveFirst()
    set varFileName = rsFSO("Name").Value

    objFSO.CopyFile "C:\Documents and Settings\Administrator\My Documents\My
    Pictures\ImageStudio\Album\Motion Images\" & varFileName,
    "C:\Inetpub\Scripts\Webcam\Images\CurrentImage.jpg"
    %>

    <img src="\images\CurrentImage.jpg">

    Thanks in advance.

    --
    _______________________________________________

    DC

    "You can not reason a man out of a position he did not reach through reason"

    "Don't use a big word where a diminutive one will suffice."

    "A man with a watch knows what time it is. A man with two watches is
    never sure." Segal's Law
     
    DC, Sep 10, 2003
    #1
    1. Advertising

  2. DC

    Tom B Guest

    Your server doesn't know what an adVarChar is

    http://www.aspfaq.com/show.asp?id=2112

    http://www.aspfaq.com/show.asp?id=2102


    "DC" <> wrote in message
    news:...
    > Im getting the error
    >
    > ADODB.Fields error '800a0bb9'
    >
    > Arguments are of the wrong type, are out of acceptable range, or are in
    > conflict with one another.
    >
    > In the following script to copy and rename the latest file in a webcam
    > folder. Any ideas why this is failing?
    >
    > <%
    > Dim objFSO, rsFSO, objFolder, File, varFileName
    > Set rsFSO = Server.CreateObject("ADODB.Recordset")
    > Set objFSO = CreateObject("Scripting.FileSystemObject")
    > Set objFolder = objFSO.GetFolder("C:\Documents and
    > Settings\Administrator\My Documents\My Pictures\ImageStudio\Album\Motion
    > Images\")
    >
    > rsFSO.Fields.Append "Name", adVarChar, 200 -----Error occurs on
    > this line.
    > rsFSO.Fields.Append "Type", adVarChar, 200
    > rsFSO.Fields.Append "DateCreated", adDate
    > rsFSO.Fields.Append "DateLastAccessed", adDate
    > rsFSO.Fields.Append "DateLastModified", adDate
    > rsFSO.Fields.Append "Size", adInteger
    > rsFSO.Fields.Append "TotalFileCount", adInteger
    > rsFSO.Open
    >
    > For Each File In objFolder.Files
    > 'hide any file that begins with the character to exclude
    > If (Left(File.Name, 1)) <> Exclude Then
    > rsFSO.AddNew
    > rsFSO("Name") = File.Name
    > rsFSO("Type") = File.Type
    > rsFSO("DateCreated") = File.DateCreated
    > rsFSO("DateLastAccessed") = File.DateLastAccessed
    > rsFSO("DateLastModified") = File.DateLastModified
    > rsFSO("Size") = File.Size
    > rsFSO.Update
    > End If
    > Next
    >
    > rsFSO.Sort = "DateLastModified"
    >
    > Set objFolder = Nothing
    > rsFSO.MoveFirst()
    > set varFileName = rsFSO("Name").Value
    >
    > objFSO.CopyFile "C:\Documents and Settings\Administrator\My Documents\My
    > Pictures\ImageStudio\Album\Motion Images\" & varFileName,
    > "C:\Inetpub\Scripts\Webcam\Images\CurrentImage.jpg"
    > %>
    >
    > <img src="\images\CurrentImage.jpg">
    >
    > Thanks in advance.
    >
    > --
    > _______________________________________________
    >
    > DC
    >
    > "You can not reason a man out of a position he did not reach through

    reason"
    >
    > "Don't use a big word where a diminutive one will suffice."
    >
    > "A man with a watch knows what time it is. A man with two watches is
    > never sure." Segal's Law
    >
     
    Tom B, Sep 10, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. just_jt
    Replies:
    0
    Views:
    718
    just_jt
    Dec 3, 2004
  2. Beau
    Replies:
    1
    Views:
    209
    Bob Barrows [MVP]
    Nov 29, 2004
  3. Replies:
    2
    Views:
    247
    Bullschmidt
    Oct 25, 2005
  4. ern edwar
    Replies:
    0
    Views:
    316
    ern edwar
    Nov 15, 2005
  5. news
    Replies:
    3
    Views:
    623
    Bob Barrows
    Jul 13, 2009
Loading...

Share This Page