Ask a Question related to ASP Database, Design and Development.
-
Laphan #1
Working OLE DB string for an Access DB
Hi All
This may be striaght forward for most, but I am really getting in a tiswas
with it.
I have been to the able consulting, connectionstrings.com et al and I still
can't get a working OLE DB connection string to work.
Could somebody PLEASE post me an OLE DB connection string that allows me to
Server.Mappath my DB and provide a password to get in it, as the DB is
password protected. FYR, my current attempt to do this is as follows:
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source="" & Server.Mappath("mydb.mdb") & "";" & _
"Jet OLEDB:Database Password=fred", _
"<I believe this is the workgroup username, but I don't
use this>", "<I believe this is the workgroup password, but I don't use
this>"
This generates:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/news-submit.asp, line 300
"Data Source="" & Server.Mappath("mydb.mdb") & "";" & _
----------------------------------^
If I put double quotes around the double quotes that already encapsulate my
mdb name, to try and encode these chars I get the following:
Microsoft OLE DB Service Components error '80040e73'
Format of the initialization string does not conform to the OLE DB
specification.
/news-submit.asp, line 299
What am I doing wrong???
Another question is, why can't I use the ConnectionString attrib like I used
to use for the ODBC variant? For example, I used to be able to set it up as
follows:
strDSN="DBQ=" & Server.Mappath("users/mydb.mdb") & ";Driver={Microsoft
Access Driver (*.mdb)}; userID=Admin; pwd=fred"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Connectionstring = strDSN
oConn.Open
I have a feeling this might be down to the new formatting of the OLE DB, but
I may be wrong.
Rgds
Laphan
Laphan Guest
-
Access DB Connection String Not working? PleaseHelp!!!!!
I had a string connection to access my database directly to the server and this is the string: PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=' &... -
DefaultValue not working (string)
My defaultvalue attribute is not working. If i drop this control from thetoolbox onto my page the properties are empty. They keep being empty if i... -
"Access Denied" using public static Process Start(string, string);
We are using Network Associates VirusScan to check files uploaded from a web page for viruses. The code below worked fine using .Net 1.1 on... -
aspx - string from method from in inherited class not working
Hi all, tricky to explain this one: have got a class called Language which extends System.Web.UI.Page Language has a method "getText()" which... -
String matching not working
Hi, I am quite new to Perl. I have several sets of data and within each individual file news stories are seperated using ========. My goal is... -
Jeff Cochran #2
Re: Working OLE DB string for an Access DB
On Mon, 9 Feb 2004 19:14:40 -0000, "Laphan" <news@DoNotEmailMe.co.uk>
wrote:
This works here (one line, watch for wrap...):>Hi All
>
>This may be striaght forward for most, but I am really getting in a tiswas
>with it.
>
>I have been to the able consulting, connectionstrings.com et al and I still
>can't get a working OLE DB connection string to work.
>
>Could somebody PLEASE post me an OLE DB connection string that allows me to
>Server.Mappath my DB and provide a password to get in it, as the DB is
>password protected.
dbConnect = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath("database.mdb") & ";Jet OLEDB:Database
Password=Password;""
Jeff
Jeff Cochran Guest
-
Aaron Bertrand - MVP #3
Re: Working OLE DB string for an Access DB
> Microsoft VBScript compilation error '800a0409'
-->
> Unterminated string constant
>
> /news-submit.asp, line 291
>
> strDSN = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
> Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database Password=password;""
> --------------------------------------------------------------------------An unterminated string constant?> --------------------------------------------------------^
>
> Do you know what could cause this??
Debugging 101. As he warned, watch out for the line breaks. And drop the
extra " at the end.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
Aaron Bertrand - MVP Guest
-
Laphan #4
Re: Working OLE DB string for an Access DB
Dear Jeff
Thanks for coming back to me, but I get:
Microsoft VBScript compilation error '800a0409'
Unterminated string constant
/news-submit.asp, line 291
strDSN = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database Password=password;""
----------------------------------------------------------------------------
--------------------------------------------------------^
Do you know what could cause this??
Jeff Cochran <jcochran.nospam@naplesgov.com> wrote in message
news:4027e2b2.544696442@msnews.microsoft.com...
On Mon, 9 Feb 2004 19:14:40 -0000, "Laphan" <news@DoNotEmailMe.co.uk>
wrote:
This works here (one line, watch for wrap...):>Hi All
>
>This may be striaght forward for most, but I am really getting in a tiswas
>with it.
>
>I have been to the able consulting, connectionstrings.com et al and I still
>can't get a working OLE DB connection string to work.
>
>Could somebody PLEASE post me an OLE DB connection string that allows me to
>Server.Mappath my DB and provide a password to get in it, as the DB is
>password protected.
dbConnect = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath("database.mdb") & ";Jet OLEDB:Database
Password=Password;""
Jeff
Laphan Guest
-
Jeff Cochran #5
Re: Working OLE DB string for an Access DB
On Mon, 9 Feb 2004 22:57:19 -0000, "Laphan" <news@DoNotEmailMe.co.uk>
wrote:
A typo in my string. :)>Dear Jeff
>
>Thanks for coming back to me, but I get:
>
>Microsoft VBScript compilation error '800a0409'
>
>Unterminated string constant
>
>/news-submit.asp, line 291
>
>strDSN = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
>Server.MapPath("mydb.mdb") & ";Jet OLEDB:Database Password=password;""
>----------------------------------------------------------------------------
>--------------------------------------------------------^
>
>Do you know what could cause this??
The last quotation mark is not supposed to be there. I edited my
password and inadvertently added double quotes.
Jeff
>Jeff Cochran <jcochran.nospam@naplesgov.com> wrote in message
>news:4027e2b2.544696442@msnews.microsoft.com...
>On Mon, 9 Feb 2004 19:14:40 -0000, "Laphan" <news@DoNotEmailMe.co.uk>
>wrote:
>>>>Hi All
>>
>>This may be striaght forward for most, but I am really getting in a tiswas
>>with it.
>>
>>I have been to the able consulting, connectionstrings.com et al and I still
>>can't get a working OLE DB connection string to work.
>>
>>Could somebody PLEASE post me an OLE DB connection string that allows me to
>>Server.Mappath my DB and provide a password to get in it, as the DB is
>>password protected.
>This works here (one line, watch for wrap...):
>
>dbConnect = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
>Server.MapPath("database.mdb") & ";Jet OLEDB:Database
>Password=Password;""
>
>Jeff
>Jeff Cochran Guest
-
Aaron Bertrand - MVP #6
Re: Working OLE DB string for an Access DB
Oh come on, show us your real password. :-)
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
> The last quotation mark is not supposed to be there. I edited my
> password and inadvertently added double quotes.
Aaron Bertrand - MVP Guest
-
Jeff Cochran #7
Re: Working OLE DB string for an Access DB
On Tue, 10 Feb 2004 11:39:14 -0500, "Aaron Bertrand - MVP"
<aaron@TRASHaspfaq.com> wrote:
Umm... I did... Doesn't *everyone* use "password" as a password? Or>Oh come on, show us your real password. :-)
do you make it hard by using an upper case P...? :)
Jeff
Jeff Cochran Guest
-
Turkbear #8
Re: Working OLE DB string for an Access DB
On Tue, 10 Feb 2004 19:29:21 GMT, [email]jcochran.nospam@naplesgov.com[/email] (Jeff Cochran) wrote:
Actually I try to make it descriptive : pASSword>On Tue, 10 Feb 2004 11:39:14 -0500, "Aaron Bertrand - MVP"
><aaron@TRASHaspfaq.com> wrote:
>>>>Oh come on, show us your real password. :-)
>Umm... I did... Doesn't *everyone* use "password" as a password? Or
>do you make it hard by using an upper case P...? :)
>
>Jeff
Jvg
Turkbear Guest
-
Jeff Cochran #9
Re: Working OLE DB string for an Access DB
On Tue, 10 Feb 2004 14:31:45 -0600, Turkbear <noone@nowhere.com>
wrote:
We used to have a database for employee titles with a limited length.>On Tue, 10 Feb 2004 19:29:21 GMT, [email]jcochran.nospam@naplesgov.com[/email] (Jeff Cochran) wrote:
>>>>On Tue, 10 Feb 2004 11:39:14 -0500, "Aaron Bertrand - MVP"
>><aaron@TRASHaspfaq.com> wrote:
>>>>>>>Oh come on, show us your real password. :-)
>>Umm... I did... Doesn't *everyone* use "password" as a password? Or
>>do you make it hard by using an upper case P...? :)
>>
>>Jeff
>Actually I try to make it descriptive : pASSword
Somehow the promotion to Senior Network Ass didn't impress me as much
as the boss thought it should...
Jeff
(Former Title: Senior Network Associate)
Jeff Cochran Guest
-
Laphan #10
Re: Working OLE DB string for an Access DB
Dear Guys
Thanks for the feedback on this.
Can I ask that once I have made a successful connection does the Connection,
Command and Recordset commands under OLEDB work in exactly the same way as
the ODBC one?
Rgds
Laphan
Jeff Cochran <jcochran.nospam@naplesgov.com> wrote in message
news:402943fc.3983397@msnews.microsoft.com...
On Tue, 10 Feb 2004 14:31:45 -0600, Turkbear <noone@nowhere.com>
wrote:
Cochran) wrote:>On Tue, 10 Feb 2004 19:29:21 GMT, [email]jcochran.nospam@naplesgov.com[/email] (JeffWe used to have a database for employee titles with a limited length.>>>>On Tue, 10 Feb 2004 11:39:14 -0500, "Aaron Bertrand - MVP"
>><aaron@TRASHaspfaq.com> wrote:
>>>>>>>Oh come on, show us your real password. :-)
>>Umm... I did... Doesn't *everyone* use "password" as a password? Or
>>do you make it hard by using an upper case P...? :)
>>
>>Jeff
>Actually I try to make it descriptive : pASSword
Somehow the promotion to Senior Network Ass didn't impress me as much
as the boss thought it should...
Jeff
(Former Title: Senior Network Associate)
Laphan Guest
-
Aaron Bertrand - MVP #11
Re: Working OLE DB string for an Access DB
I think there are a few minor differences but most of OLEDB is a superset,
IIRC. In other words, switching to OLEDB from ODBC, you are very unlikely
to lose any functionality. In fact, I think it is very doubtful that any
differences will be noticeable in an ASP application.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Laphan" <news@DoNotEmailMe.co.uk> wrote in message
news:uEiHdNN8DHA.2416@TK2MSFTNGP10.phx.gbl...Connection,> Dear Guys
>
> Thanks for the feedback on this.
>
> Can I ask that once I have made a successful connection does the> Command and Recordset commands under OLEDB work in exactly the same way as
> the ODBC one?
>
> Rgds
>
> Laphan
>
> Jeff Cochran <jcochran.nospam@naplesgov.com> wrote in message
> news:402943fc.3983397@msnews.microsoft.com...
> On Tue, 10 Feb 2004 14:31:45 -0600, Turkbear <noone@nowhere.com>
> wrote:
>> Cochran) wrote:> >On Tue, 10 Feb 2004 19:29:21 GMT, [email]jcochran.nospam@naplesgov.com[/email] (Jeff>> >> >> >>On Tue, 10 Feb 2004 11:39:14 -0500, "Aaron Bertrand - MVP"
> >><aaron@TRASHaspfaq.com> wrote:
> >>
> >>>Oh come on, show us your real password. :-)
> >>
> >>Umm... I did... Doesn't *everyone* use "password" as a password? Or
> >>do you make it hard by using an upper case P...? :)
> >>
> >>Jeff
> >Actually I try to make it descriptive : pASSword
> We used to have a database for employee titles with a limited length.
> Somehow the promotion to Senior Network Ass didn't impress me as much
> as the boss thought it should...
>
> Jeff
> (Former Title: Senior Network Associate)
>
>
Aaron Bertrand - MVP Guest
-
Laphan #12
Re: Working OLE DB string for an Access DB
Thanks for the prompt reply Aaron.
I was just worried that a command such as making the connection client-side
for paging (this is right isn't it?), would be different.
Rgds
Laphan
Aaron Bertrand - MVP <aaron@TRASHaspfaq.com> wrote in message
news:uGO74QN8DHA.2796@TK2MSFTNGP09.phx.gbl...
I think there are a few minor differences but most of OLEDB is a superset,
IIRC. In other words, switching to OLEDB from ODBC, you are very unlikely
to lose any functionality. In fact, I think it is very doubtful that any
differences will be noticeable in an ASP application.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Laphan" <news@DoNotEmailMe.co.uk> wrote in message
news:uEiHdNN8DHA.2416@TK2MSFTNGP10.phx.gbl...Connection,> Dear Guys
>
> Thanks for the feedback on this.
>
> Can I ask that once I have made a successful connection does the> Command and Recordset commands under OLEDB work in exactly the same way as
> the ODBC one?
>
> Rgds
>
> Laphan
>
> Jeff Cochran <jcochran.nospam@naplesgov.com> wrote in message
> news:402943fc.3983397@msnews.microsoft.com...
> On Tue, 10 Feb 2004 14:31:45 -0600, Turkbear <noone@nowhere.com>
> wrote:
>> Cochran) wrote:> >On Tue, 10 Feb 2004 19:29:21 GMT, [email]jcochran.nospam@naplesgov.com[/email] (Jeff>> >> >> >>On Tue, 10 Feb 2004 11:39:14 -0500, "Aaron Bertrand - MVP"
> >><aaron@TRASHaspfaq.com> wrote:
> >>
> >>>Oh come on, show us your real password. :-)
> >>
> >>Umm... I did... Doesn't *everyone* use "password" as a password? Or
> >>do you make it hard by using an upper case P...? :)
> >>
> >>Jeff
> >Actually I try to make it descriptive : pASSword
> We used to have a database for employee titles with a limited length.
> Somehow the promotion to Senior Network Ass didn't impress me as much
> as the boss thought it should...
>
> Jeff
> (Former Title: Senior Network Associate)
>
>
Laphan Guest
-
Aaron Bertrand - MVP #13
Re: Working OLE DB string for an Access DB
> I was just worried that a command such as making the connection
client-sideI have no idea what you're talking about...> for paging (this is right isn't it?), would be different.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #14
Re: Working OLE DB string for an Access DB
> > I was just worried that a command such as making the connection
Sorry, this was a little harsh, I thought your comment had to do with> client-side>> > for paging (this is right isn't it?), would be different.
> I have no idea what you're talking about...
shopping carts (how do you keep track of so many threads you've started???).
I never "make the connection client-side for paging" but I'm pretty sure the
technique will be the same for both OLEDB and ODBC. You could always try it
with your existing code, you'll get a definitive answer faster than an
opinion from here.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
Aaron Bertrand - MVP Guest
-
Bob Barrows [MVP] #15
Re: Working OLE DB string for an Access DB
Laphan wrote:
There is no reason that it would be different. You are talking about setting> Thanks for the prompt reply Aaron.
>
> I was just worried that a command such as making the connection
> client-side for paging (this is right isn't it?), would be different.
>
properties (CursorLocation, etc.) of "ADO recordsets", not "ODBC ADO
recordsets" or "OLEDB ADO recordsets". All of these properties and their
settings (aka enumerations) are contained in the ADO library, which is
totally separate from the ODBC and OLEDB libraries.
So the settings will not change. What may vary from one provider to another
is the ability of the provider to implement the desired setting. In the case
of Access and SQL Server, however, this is not an issue. When you get into
third-party databases and providers, then you may run into issues.
HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Laphan #16
Re: Working OLE DB string for an Access DB
Sorry for the frantic posting, but when I'm on one, I'm basically on one.
Just to finish this thread, I though it was interesting that you said that
you don't use paging to show records on your ASP pages. I didn't know there
was a different way of doing this or do you simply not do the '10 products
per page' scenario?
Rgds
Laphan
Aaron Bertrand - MVP <aaron@TRASHaspfaq.com> wrote in message
news:uc1Xi5N8DHA.4060@tk2msftngp13.phx.gbl...Sorry, this was a little harsh, I thought your comment had to do with> client-side> > I was just worried that a command such as making the connection>> > for paging (this is right isn't it?), would be different.
> I have no idea what you're talking about...
shopping carts (how do you keep track of so many threads you've started???).
I never "make the connection client-side for paging" but I'm pretty sure the
technique will be the same for both OLEDB and ODBC. You could always try it
with your existing code, you'll get a definitive answer faster than an
opinion from here.
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
Laphan Guest
-
Aaron Bertrand [MVP] #17
Re: Working OLE DB string for an Access DB
> you said that
When did I say that? I said I don't "make the connection client-side"...> you don't use paging to show records on your ASP pages.
see [url]http://www.aspfaq.com/2120[/url]
Aaron Bertrand [MVP] Guest
-
Astra #18
Re: Working OLE DB string for an Access DB
Sorry Aaron
Newbie piffle came out of my fingers.
Was I close to the mark in my follow up post re eCommerce/Shopping Cart
Experience?
Rgds
Laphan
"Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
news:%23$fkMtW8DHA.1816@TK2MSFTNGP12.phx.gbl...When did I say that? I said I don't "make the connection client-side"...> you said that
> you don't use paging to show records on your ASP pages.
see [url]http://www.aspfaq.com/2120[/url]
Astra Guest



Reply With Quote

