Ask a Question related to ASP Database, Design and Development.
-
bbxrider #1
open and read an access mdb
this is a little long but pretty basic, just trying to open the table
'volunteerPrimary'
and read back all the fields in it
the code i'm trying to execute at the server is:
<script language="vbscript" runat="server">
<!-- open access data base with ado -->
const adOpenDynamic =2
const adLockOptimistic =3
const adCmdTable =2
private rs
private firstname, lastname
dim strDbConnection
Dim fld
dim recSource
recSource = "SELECT * FROM volunteerPrimary"
strDbConnection = "provider=microsoft.jet.oledb.4.0;" & _
"data source=e:\inetpub\wwwroot\webasp\volunteer.mdb;"
set rs = server.createobject("adodb.recordset")
rs.open recSource, strDbConnect, adOpenDynamic, adLockOptimistic, adCmdTable
For Each fld In rs.Fields
response.write "next field found in table volunteerPrimary is " &
fld.value & "<br>"
Next
rs.close
set rs = nothing
</script>
the error i'm getting is:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/phsVolunteerData.asp, line 58
if i substitute 'volunteerPrimary' for 'recSource' in the rs.open, it seems
to open ok, can anybody see what i'm doing wrong??
and..... when i try to 'dim fld as adodb.field' i get an error on that,
expecting end of statement. so in vb script are all variables set up like
the 'variants' in vb??
bbxrider Guest
-
to open a pdf: at first agree to the terms,than it's possible to read the pdf
Hi everybody, in the moment i have the following problem: for customers i have created an acrobat pdf-file. so i wish that every user who will... -
Read-Only Access
I am new to Cold Fusion, is it possible to access a database as read-only? Due to the size of some of my tables, it takes forever for a single... -
Read/Write Access Error
When trying to export a document that has a vector image in it as an eps, I get the following error: Error: Could not save the document because... -
read/write access
I'm using FH 10 on a Windows 2000 PC at work, and yesterday when I tried to print I got a dialogue that said the command couldn't be completed... -
Open Access form without Access behind it
How can I start(open) an Access form without having the Access database window opening behind it? Thanks, Ray Maas -
only me #2
Re: open and read an access mdb
Less code = less potential for error
90% of the time the Conn.execute(sql) will do all you need
dim rs,sql,conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=
e:\inetpub\wwwroot\webasp\volunteer.mdb;"
sql = "SELECT * FROM volunteerPrimary"
set rs = Conn.execute(sql)
do while not rs.EOF
response.write blah blah
loop
rs.close
"bbxrider" <bbxrider1@comcast.net> wrote in message
news:OnvsjLZTDHA.1288@tk2msftngp13.phx.gbl...adCmdTable> this is a little long but pretty basic, just trying to open the table
> 'volunteerPrimary'
> and read back all the fields in it
>
> the code i'm trying to execute at the server is:
> <script language="vbscript" runat="server">
> <!-- open access data base with ado -->
> const adOpenDynamic =2
> const adLockOptimistic =3
> const adCmdTable =2
> private rs
> private firstname, lastname
> dim strDbConnection
> Dim fld
> dim recSource
> recSource = "SELECT * FROM volunteerPrimary"
> strDbConnection = "provider=microsoft.jet.oledb.4.0;" & _
> "data source=e:\inetpub\wwwroot\webasp\volunteer.mdb;"
> set rs = server.createobject("adodb.recordset")
> rs.open recSource, strDbConnect, adOpenDynamic, adLockOptimistic,seems> For Each fld In rs.Fields
> response.write "next field found in table volunteerPrimary is " &
> fld.value & "<br>"
> Next
> rs.close
> set rs = nothing
> </script>
>
> the error i'm getting is:
> ADODB.Recordset error '800a0bb9'
>
> Arguments are of the wrong type, are out of acceptable range, or are in
> conflict with one another.
>
> /phsVolunteerData.asp, line 58
>
> if i substitute 'volunteerPrimary' for 'recSource' in the rs.open, it> to open ok, can anybody see what i'm doing wrong??
>
> and..... when i try to 'dim fld as adodb.field' i get an error on that,
> expecting end of statement. so in vb script are all variables set up like
> the 'variants' in vb??
>
>
>
>
only me Guest
-
Mosley #3
Re: open and read an access mdb
"bbxrider" <bbxrider1@comcast.net> wrote in message
news:epK9$HcTDHA.2220@TK2MSFTNGP11.phx.gbl...trying> thanks a lot, that works, duh, can't believe such a dumb mistake, am> to figure out why to
> leave out the asCmdTable.
more to the point, why put it in?
caused a error for me
in> "Mosley" <home@that.com> wrote in message
> news:Ok5QBybTDHA.2280@TK2MSFTNGP12.phx.gbl...> fld.value> >
> > "bbxrider" <bbxrider1@comcast.net> wrote in message
> > news:OnvsjLZTDHA.1288@tk2msftngp13.phx.gbl...> >> > > this is a little long but pretty basic, just trying to open the table
> > > 'volunteerPrimary'
> > > and read back all the fields in it
> > >
> >
> > you are using "strDbConnect" to connect when you set varible as
> > "strDbConnection"
> >
> > remove ", adCmdTable"
> >
> >
> > your new code
> >
> >
> > <script language="vbscript" runat="server">
> > const adOpenDynamic =2
> > const adLockOptimistic =3
> > const adCmdTable =2
> > private rs
> > private firstname, lastname
> > dim strDbConnection
> > Dim fld
> > dim recSource
> > recSource = "SELECT * FROM lastDate"
> > strDbConnection = "provider=microsoft.jet.oledb.4.0;" & _ "data
> > source=c:\temp\stats.mdb;"
> > set rs = server.createobject("adodb.recordset")
> > rs.open recSource, strDbConnection,adOpenDynamic,adLockOptimistic
> > For Each fld In rs.Fields
> > response.write "next field found in table volunteerPrimary is " &> > Next
> > rs.close set rs = nothing
> >
> >
> >
> >
> >
> >> >> > > the code i'm trying to execute at the server is:
> > > <script language="vbscript" runat="server">
> > > <!-- open access data base with ado -->
> > > const adOpenDynamic =2
> > > const adLockOptimistic =3
> > > const adCmdTable =2
> > > private rs
> > > private firstname, lastname
> > > dim strDbConnection
> > > Dim fld
> > > dim recSource
> > > recSource = "SELECT * FROM mytable"
> > > strDbConnection = "provider=microsoft.jet.oledb.4.0;" & _
> > > "data source=e:\inetpub\wwwroot\webasp\volunteer.mdb;"
> > > set rs = server.createobject("adodb.recordset")
> > > rs.open recSource, strDbConnect, adOpenDynamic, adLockOptimistic
> >
> >
> >
> >> > > For Each fld In rs.Fields
> > > response.write "next field found in table volunteerPrimary is " &
> > > fld.value & "<br>"
> > > Next
> > > rs.close
> > > set rs = nothing
> > > </script>
> > >
> > > the error i'm getting is:
> > > ADODB.Recordset error '800a0bb9'
> > >
> > > Arguments are of the wrong type, are out of acceptable range, or arethat,> > seems> > > conflict with one another.
> > >
> > > /phsVolunteerData.asp, line 58
> > >
> > > if i substitute 'volunteerPrimary' for 'recSource' in the rs.open, it> > > to open ok, can anybody see what i'm doing wrong??
> > >
> > > and..... when i try to 'dim fld as adodb.field' i get an error on> like> > > expecting end of statement. so in vb script are all variables set up>> >> > > the 'variants' in vb??
> > >
> > >
> > >
> > >
> >
>
Mosley Guest



Reply With Quote

