Re: ADO Error ( think)

From: Val Mazur (group51a_at_hotmail.com)
Date: 07/03/04

  • Next message: Val Mazur: "Re: ADO Error accessing Sybase Adaptive Server Anywhere 0 after installing 9.0.1.1862 patch"
    Date: Fri, 2 Jul 2004 22:45:22 -0400
    
    

    It should be (you need to put file name into square brackets)

    SELECT * FROM [FileNameHere]

    -- 
    Val Mazur
    Microsoft MVP
    "Willie Bodger" <willie@bodgerfam.com> wrote in message 
    news:uxsEXmEYEHA.1652@TK2MSFTNGP09.phx.gbl...
    > OK, I see that, now how do I refer to that entity? i.e if I am using a SQL
    > Server database, once I have created the connection to the database I say
    > 'SELECT * FROM tblname WHERE criteria are met', but with this model, what 
    > do
    > I use in the from for my select clause? My file has only one field,
    > SerialNumber and the file is called tSerialNumbers.csv if that helps. 
    > Thanks
    > again for helping me understand this.
    >
    > wb
    > "Val Mazur" <group51a@hotmail.com> wrote in message
    > news:eQM2x09XEHA.2672@TK2MSFTNGP09.phx.gbl...
    >> Hi,
    >>
    >> When you open connection do you specify file name in a path as well? If
    > yes,
    >> then it is not correct, because you should specify only folder name,
    > without
    >> the file name. When you open connection it treats folder as a database,
    > but
    >> later on you use SELECT SQL statement to select actual data from the file
    >>
    >> -- 
    >> Val Mazur
    >> Microsoft MVP
    >>
    >>
    >> "Willie Bodger" <willie@bodgerfam.com> wrote in message
    >> news:OMdfGB8XEHA.1000@TK2MSFTNGP12.phx.gbl...
    >> > Hmm Thank you, that got me past that error. Now something odd is
    >> > happening.
    >> > I'm uploading a file via ASPUpload, then using the intrinsic properties
    >> > there to identify the location of the file for the ADO call, but it is
    >> > saying the file is not at that location, although it is at that
    > location.
    >> > I
    >> > am running XP Pro with IIS installed so I can do everything locally,
    >> > except
    >> > my database is not local. However, isn't this just a local call? Well,
    >> > here's the code and the error: Thanks for any other info you can help 
    >> > me
    >> > with. wb
    >> >
    >> > Dim Upload
    >> > Set Upload = Server.CreateObject("Persits.Upload.1")
    >> > Upload.Save "c:\upload"
    >> > For Each File in Upload.Files
    >> >    filepath= File.Path
    >> > Next
    >> > Response.Write filepath
    >> > 'Response.End
    >> >
    >> > ' Create the connection object
    >> > Dim cnn, strConn, rs
    >> > Set cnn = Server.CreateObject("ADODB.Connection") ' build the 
    >> > connection
    >> > string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
    >> > filepath
    >> > & ";Extended Properties=""text;HDR=Yes;FMT=Delimited""" cnn.Open 
    >> > strConn
    >> > 'open the connection  (THIS IS line 20)
    >> >
    >> > Error Type:
    >> > Microsoft JET Database Engine (0x80004005)
    >> > 'c:\upload\tSerialNumbers.csv' is not a valid path. Make sure that the
    >> > path
    >> > name is spelled correctly and that you are connected to the server on
    >> > which
    >> > the file resides.
    >> > /adoparse.asp, line 20
    >> >
    >> > "Val Mazur" <group51a@hotmail.com> wrote in message
    >> > news:ecIQtR6XEHA.2016@TK2MSFTNGP11.phx.gbl...
    >> >> Hi,
    >> >>
    >> >> try to use next connection string
    >> >>
    >> >> Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filepath & ";Extended
    >> >> Properties=""text;HDR=Yes;FMT=Delimited"""
    >> >>
    >> >> -- 
    >> >> Val Mazur
    >> >> Microsoft MVP
    >> >>
    >> >>
    >> >> "Willie Bodger" <willie@bodgerfam.com> wrote in message
    >> >> news:eARc3p5XEHA.3476@tk2msftngp13.phx.gbl...
    >> >> > Ok, I am trying to deal with an uploaded CSV file that I want to
    > place
    >> > the
    >> >> > values of into my database along with one other column that will be
    >> > passed
    >> >> > via the form and will be the same for all the values from that
    >> > particular
    >> >> > csv (which has only one field). In an effort to avoid Bulk Insert, I
    >> > began
    >> >> > poking around and found this possible ADO solution to read it into a
    >> >> > recordset:
    >> >> > Dim cnn, strConn, rs Set cnn =
    > Server.CreateObject("ADODB.Connection")
    >> >> > (Line 20) strConn = "Driver={Microsoft Text Driver (*.txt; *.csv)};
    >> >> > DEFAULTDIR=" & filepath & "; Extensions=csv; Persist Security
    >> > Info=False"
    >> >> > cnn.Open strConn 'open the connection
    >> >> > But when I try it I get the error below. I have isolated everything
    >> >> > else
    >> >> > and
    >> >> > this is the piece that breaks, but I'm really not that well versed 
    >> >> > in
    >> > ADO,
    >> >> > so any help you all could provide me would be greatly appreciated.
    >> >> >
    >> >> > wb
    >> >> >  a.. Error Type:
    >> >> >  Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    >> >> >  [Microsoft][ODBC Text Driver]General error Unable to open registry
    > key
    >> >> > 'Temporary (volatile) Jet DSN for process 0x838 Thread 0xd38 DBC
    >> > 0x10d5904
    >> >> > Text'.
    >> >> >  /adoparse.asp, line 20
    >> >> >
    >> >> >
    >> >> >  b.. Browser Type:
    >> >> >  Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR
    > 1.1.4322)
    >> >> >
    >> >> >  c.. Page:
    >> >> >  POST 542 bytes to /adoparse.asp
    >> >> >
    >> >> >  d.. POST Data:
    >> >> >  error '80020009'
    >> >> >  Exception occurred.
    >> >> >
    >> >> >  /iisHelp/common/500-100.asp, line 223
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >
    >>
    >>
    >
    > 
    

  • Next message: Val Mazur: "Re: ADO Error accessing Sybase Adaptive Server Anywhere 0 after installing 9.0.1.1862 patch"

    Relevant Pages

    • Re: How the connection Work?
      ... some staff and close connection as soon as possible. ... database, than it basically takes no time to open connection after ... > and close a connectioin each time a want to perform a query. ... > "Val Mazur" wrote in message ...
      (microsoft.public.vb.database.ado)
    • Re: How the connection Work?
      ... I have a VB6 program that runs many queries on a database. ... and close a connectioin each time a want to perform a query. ... be better to just open one connection, keep this one open all the time ... > Val Mazur ...
      (microsoft.public.vb.database.ado)
    • Re: ADO Connection Timeout
      ... so what happens when a connection failure forces one station to revert ... to a local database? ... Further, you *will* have contention issues, Jet does not support record ... to the central server, but you are willing to live with periods where it ...
      (microsoft.public.data.ado)
    • Re: ADO Connection Timeout
      ... When the first test is run, the results are stored in the central database. ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
      (microsoft.public.data.ado)
    • Re: ADO Connection Timeout
      ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
      (microsoft.public.data.ado)