[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Drivers error '80004005'

Posted on 1999-12-01
58
Medium Priority
?
270 Views
Last Modified: 2012-06-27
Having this error message

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.

/testresponse.asp, line 35



what to do
thanks in advance
0
Comment
Question by:tparvaiz
  • 27
  • 20
  • 7
  • +1
58 Comments
 
LVL 18

Expert Comment

by:mgfranz
ID: 2247857
This is a Windows NT permissions problem. The account that is accessing the page doesn't have sufficient permissions to lock the database. The account would be either the anonymous account (by default the IUSR_<machinename>) or a specific user account if the page has been secured for authenticated access.
If the page is meant to be accessed anonymously, give the IUSR_<machinename> account full control to the ASP page, and the folder and files where the database is located. Additionally, if the path to the database is being referenced using UNC (\\Server\Share), ensure that the Share Permissions allow the IUSR_<machinename> account full access. This step applies even if the share is on the local Web server.

If the page has been secured such that the IUSR_<machinename> can't access the file or database, then ensure that the user's account that is being authenticated has full control to the appropriate folders and files.

At a minimum, the account being used needs Create, Destroy, Read, Write to work with the .ldb file. Specific permission can be applied to the database to limit access.

0
 

Author Comment

by:tparvaiz
ID: 2247879
Thanks for your suggestion:
My question is how to do :

"If the page is meant to be accessed anonymously, give the USR_<machinename> account full control to the ASP page"


I've created an asp page @ c->intetpub->wwwroot->manager.

I've stored my second asp file at the same path.

My second asp file is accessing database to add recodrd, but having error message.

I've followed the same procedure before and it worked but not this time.

thanks


0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2247886
What directory is the dB located in?  

Does your asp page access the dB with an account request?  
Is the dB permissions locked to the IUSER_ACCOUNT?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:tparvaiz
ID: 2247905
My database is @

c:\WINNT\Profiles\Administrator.000\Personal\


please explain what do you meant by:

"Is the dB permissions locked to the IUSER_ACCOUNT?"


thanks for your precious time


0
 
LVL 9

Expert Comment

by:TTom
ID: 2248001
The IUSR_machinename account must have access to the directory "C:\winnt\profiles\administrator.000\personal".

That is pretty unlikely, so you probably need to change the NT permissions or move the file.

Tom
0
 

Author Comment

by:tparvaiz
ID: 2248012
what is IUSR_machinename and how can I give access to directoryC:\winnt\profiles\administrator.000\personal

and where should I move the file?


thanks
0
 

Author Comment

by:tparvaiz
ID: 2250629
I am using following code: and getting above error.

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#INCLUDE VIRTUAL="adovbs.inc" -->
<HTML>
<HEAD>
<%
Dim MyConn, RS, RS2, strFirstName, strLastName, strUserName, strPassword
Dim first, last, company, street, city, country
Dim province, zip, phone, email, item_qty, item_name, item_description


first=request.form("field_firstname")
last=request.form("field_lastname")
company=request.form("field_company")
street=request.form("field_billing_street")
city=request.form("field_billing_city")
country=request.form("field_billing_country")
province=request.form("field_provence")
zip=request.form("field_billing_zip")
phone=request.form("field_phone")
email=request.form("field_customer_email")
item_qty=request.form("field_item_qty")
item_name=request.form("text_area_item")
item_description=request.form("text_area_description")
'grab the form contents


Set MyConn=Server.CreateObject("ADODB.Connection")
Set RS=Server.CreateObject("ADODB.RecordSet")
'since you are working with the RecordSet you need to create an instance of the RecordSet Object

Set RS2=Server.CreateObject("ADODB.RecordSet")
'in this case, since we're adding to two separate tables we need to create two instances of the RecordSet Object

MyConn.Open "chdata"
'getdata is your DSN (data source name) you created in ODBC

RS.Open "Select * From tblcompanyaddress", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
RS2.Open "Select * From tblcompanyinfo", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
'open both RecordSets

RS.AddNew
RS("company")= company
RS("street")= street
RS("city")= city
RS("country")= country
RS("province")= province
RS("zip")= zip  
RS.Update
'Update the first RecordSet


RS2.AddNew
RS2("company")= company
RS2("contact_first_name")= first
RS2("contact_last_name")= last
RS2("contact_ph_no")= phone
RS2("contact_email")= email
RS2.Update
'Update the second RecordSet

RS.Close
RS2.Close
MyConn.Close
%>


</HEAD>
<BODY>

<P>&nbsp;</P>

</BODY>
</HTML>


0
 

Author Comment

by:tparvaiz
ID: 2250634
ASP files are at

tparvaiz.webhostme.com/bestuserinterface.asp
0
 

Author Comment

by:tparvaiz
ID: 2250643
When I've put it over web, getting this error messages

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/testresponse.asp, line 35


Defenately there is some error in Coding
thanks
0
 

Author Comment

by:tparvaiz
ID: 2250656
from the web-hosting company I was send this procedure to follow:



/*****************//////////////
How to create an DSN-LESS connection using ADO


Description:
This document is provided to help you connect to your Access databases using native Microsoft Jet OLEDB provider and without an DSN.  All the information provided should be considered "as is".  No further programming support will be provided by WebHostMe other than the listing of the code here.


Sample Code for DSN-Less database connection

Begin Conn Open <BR>
<%
Set AdoConn = Server.CreateObject ("ADODB.Connection")
AdoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
AdoConn.ConnectionString = "Data Source=" & Server.MapPath ("/cgi-bin/mydatabase.mdb") 'Put the DB in cgi-bin for write access
AdoConn.Open
Set AdoConn = nothing
%>
Connection Open Complete<BR>



///////////*************

please edit my code according to the requirement
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2250672
Do you have a DSN connection created?  If not, you either need to create one in the ODBC manager, or use a DSN less connection;

Change your MyConn.Open line to this;

MyConn.Open "DBQ=" & Server.MapPath("chdata.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

This assumes the database name is chdata.mdb.

Mark


0
 

Author Comment

by:tparvaiz
ID: 2250691
Getting this error
///////starting error message////////
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/testresponse.asp, line 35

MyConn.Open "DBQ=" &amp; Server.MapPath("chdata.mdb") &amp; ";Driver={Microsoft



///////////End///////////////////

and a dashed line is pointing toward ';' of '&amp;'



I've changed my code to

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#INCLUDE VIRTUAL="adovbs.inc" -->
<HTML>
<HEAD>
<%
Dim MyConn, RS, RS2, strFirstName, strLastName, strUserName, strPassword
Dim first, last, company, street, city, country
Dim province, zip, phone, email, item_qty, item_name, item_description


first=request.form("field_firstname")
last=request.form("field_lastname")
company=request.form("field_company")
street=request.form("field_billing_street")
city=request.form("field_billing_city")
country=request.form("field_billing_country")
province=request.form("field_provence")
zip=request.form("field_billing_zip")
phone=request.form("field_phone")
email=request.form("field_customer_email")
item_qty=request.form("field_item_qty")
item_name=request.form("text_area_item")
item_description=request.form("text_area_description")
'grab the form contents


Set MyConn=Server.CreateObject("ADODB.Connection")
Set RS=Server.CreateObject("ADODB.RecordSet")
'since you are working with the RecordSet you need to create an instance of the RecordSet Object

Set RS2=Server.CreateObject("ADODB.RecordSet")
'in this case, since we're adding to two separate tables we need to create two instances of the RecordSet Object

MyConn.Open "DBQ=" &amp; Server.MapPath("chdata.mdb") &amp; ";Driver={Microsoft
Access Driver (*.mdb)};"
'getdata is your DSN (data source name) you created in ODBC

RS.Open "Select * From tblcompanyaddress", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
RS2.Open "Select * From tblcompanyinfo", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
'open both RecordSets

RS.AddNew
RS("company")= company
RS("street")= street
RS("city")= city
RS("country")= country
RS("province")= province
RS("zip")= zip  
RS.Update
'Update the first RecordSet


RS2.AddNew
RS2("company")= company
RS2("contact_first_name")= first
RS2("contact_last_name")= last
RS2("contact_ph_no")= phone
RS2("contact_email")= email
RS2.Update
'Update the second RecordSet

RS.Close
RS2.Close
MyConn.Close
%>


</HEAD>
<BODY>

<P>&nbsp;</P>

</BODY>
</HTML>



0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2250763
You can't have your string in VB with ascii characters.  take out the &amp; and replace it with just &

Mark
0
 

Author Comment

by:tparvaiz
ID: 2250779
getting this error-message

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/testresponse.asp, line 35
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2250850
This tells me that the dB is not in the path specified.  Move the dB file to the same directory as the .asp files.

Mark
0
 

Author Comment

by:tparvaiz
ID: 2250886
I've tried it that too. There must be something else missing from my code

thanks for your time
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2250896
0
 

Author Comment

by:tparvaiz
ID: 2250923
I've tried it that too. There must be something else missing from my code

thanks for your time
0
 
LVL 3

Expert Comment

by:manojamin
ID: 2251034
Read this, It will help you...

Error Message: Microsoft OLE DB Provider for ODBC Drivers Error '80004005'
http://support.microsoft.com/support/kb/articles/Q238/9/71.ASP
0
 

Author Comment

by:tparvaiz
ID: 2251074
Hi,
I went to the following URL :
http://support.microsoft.com/support/kb/articles/Q238/9/71.ASP

During editing registry, I am unable to follow this step:

3. On the Security menu, select Permissions.

Please help me

Thanks for your time
0
 
LVL 3

Expert Comment

by:manojamin
ID: 2251084
That mean you do not have the permission to read that security descriptors...

Are you logeed in as Admin?
Do you have full control over the registry?

You are using regedt32, aren't you?

0
 

Author Comment

by:tparvaiz
ID: 2251112
I do have admin permissions.
I have full control over the registry.

I am just typing regedit.exe at start-run.

Let me know what should I do next
Thanks
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2251228
type in regedt32.exe

But you really shouldn't have to modify these permissions.  It won't hurt to try though.

Mark
0
 

Author Comment

by:tparvaiz
ID: 2251251
same error.
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2251285
What is in your adovbs.inc file?  

This line is on one line isn't it? No <CR> at all.

MyConn.Open "DBQ=" & Server.MapPath("chdata.mdb") & ";Driver={Microsoft
Access Driver (*.mdb)};"
0
 
LVL 9

Expert Comment

by:TTom
ID: 2252578
But you are talking about making this work on an ISP's box, not on your development box, no?

If that's the case, the code the ISP gave you is exactly what you need to do.

<%
Set AdoConn = Server.CreateObject ("ADODB.Connection")

AdoConn.Provider = "Microsoft.Jet.OLEDB.4.0"

AdoConn.ConnectionString = "Data Source=" & Server.MapPath ("/cgi-bin/mydatabase.mdb") 'Put the DB in cgi-bin for write access

AdoConn.Open
%>

Where the CR's represent the code which must be on the same line.  That will open a connection to the database on the ISP's server in your cgi-bin directory.

Tom
0
 

Author Comment

by:tparvaiz
ID: 2253326
Tom
How am I going to convert this part of my code, as described by ISP


Set MyConn=Server.CreateObject("ADODB.Connection")
Set RS=Server.CreateObject("ADODB.RecordSet")
'since you are working with the RecordSet you need to create an instance of the RecordSet Object

Set RS2=Server.CreateObject("ADODB.RecordSet")
'in this case, since we're adding to two separate tables we need to create two instances of the RecordSet Object

MyConn.Open "DBQ="&Server.MapPath("chdata.mdb")&"Driver={Microsoft Access Driver (*.mdb)};"
'getdata is your DSN (data source name) you created in ODBC

RS.Open "Select * From tblcompanyaddress", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
RS2.Open "Select * From tblcompanyinfo", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
'open both RecordSets

RS.AddNew
RS("company")= company
RS("street")= street
RS("city")= city
RS("country")= country
RS("province")= province
RS("zip")= zip  
RS.Update
'Update the first RecordSet


RS2.AddNew
RS2("company")= company
RS2("contact_first_name")= first
RS2("contact_last_name")= last
RS2("contact_ph_no")= phone
RS2("contact_email")= email
RS2.Update
'Update the second RecordSet

RS.Close
RS2.Close
MyConn.Close







thanks
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253434
Do you still get the error with this code?

Try this hack;

RS.Open "Select * From tblcompanyaddress", MyConn, 3, 3

RS2.Open "Select * From tblcompanyinfo", MyConn, 3, 3


Instead of using this;

RS.Open "Select * From tblcompanyaddress", MyConn, adOpenDynamic, adLockPessimistic, adCMDText
RS2.Open "Select * From tblcompanyinfo", MyConn, adOpenDynamic, adLockPessimistic, adCMDText

Mark
0
 

Author Comment

by:tparvaiz
ID: 2253482
Noops,
Still not working
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253500
What is it that is not working, are you not connecting to the dB?  Is the data not updating?

Are you passing the data in from a form page?
0
 
LVL 9

Expert Comment

by:TTom
ID: 2253513
To convert according to THEIR suggestion:

Set MyConn = Server.CreateObject ("ADODB.Connection")

MyConn.Provider = "Microsoft.Jet.OLEDB.4.0"

MyConn.ConnectionString = "Data Source=" & Server.MapPath ("/cgi-bin/chdata.mdb")

MyConn.Open

That should get things working PROVIDED that your database, chdata.mdb, is located in a /cgi-bin directory under your root directory.  You need to be careful about where the database is located because there will be files WRITTEN to the directory in order to use ACCESS.  That's why your ISP commented as above.

Tom

0
 

Author Comment

by:tparvaiz
ID: 2253518
Here are my two ASP files: from one asp file I am doing data validation and passing on to another ASP page for data storage


//////////////formValidation.asp//////////
<%@ Language=VBScript %>
<HTML>
<HEAD>
<SCRIPT LANGUAGE="VBScript">

sub button1_onclick()

  Select Case True
  Case FORM1.field_firstname.value = "" 
    msgbox "Please Enter First Name"
    ret = false
    call FORM1.field_firstname.focus()
  Case FORM1.field_lastname.value = "" 
    msgbox "Please Enter Last Name"
    ret = false
    call FORM1.field_lastname.focus()
  Case FORM1.field_company.value = "" 
    msgbox "Please Enter Company Name"
    ret = false
    call FORM1.field_company.focus()
  Case FORM1.field_billing_street.value = "" 
    msgbox "Please Enter Street No"
    ret = false
    call FORM1.field_billing_street.focus()
  Case FORM1.field_billing_city.value = "" 
    msgbox "Please Enter City"
    ret = false
    call FORM1.field_billing_city.focus()
  Case FORM1.field_billing_country.value = "" 
    msgbox "Please Enter Country"
    ret = false
    call FORM1.field_billing_country.focus()
  Case FORM1.field_provence.value = "" 
    msgbox "Please Enter Provence"
    ret = false
    call FORM1.field_provence.focus()
  Case FORM1.field_billing_zip.value = "" 
    msgbox "Please Enter Zip Code"
    ret = false
    call FORM1.field_billing_zip.focus()
  Case FORM1.field_phone.value = "" 
    msgbox "Please Enter Ph #"
    ret = false
    call FORM1.field_phone.focus()
  Case FORM1.field_customer_email.value = "" 
    msgbox "Please Enter Valid Email"
    ret = false
    call FORM1.field_customer_email.focus()
  Case FORM1.field_item_qty.value = "" 
    msgbox "Please Enter item quantity"
    ret = false
    call FORM1.field_item_qty.focus()
  Case FORM1.text_area_item.value = "" 
    msgbox "Please Enter Item Name"
    ret = false
      call FORM1.text_area_item.focus()
  Case FORM1.text_area_description.value = "" 
    msgbox "Please Enter description of item"
    ret = false
    call FORM1.text_area_description.focus()
  Case else
    call FORM1.submit()
 End Select

End sub

</SCRIPT>
</HEAD>
<BODY>
<CENTER>
<P style="FONT-SIZE: x-large">Order Form</P>
<P style="FONT-SIZE: medium">Please provide the following information, then
click Submit:</P>
<P>
<FORM action=testresponse.asp id=FORM1 method=post name=FORM1>
<TABLE align=center bgColor=linen border=1 cellPadding=1 cellSpacing=1
width="75%">
 
  <TR>
    <TD>
      <P>Title</P>
      <P>First Name </P></TD>
    <TD>
      <P>
      <TABLE border=1 cellPadding=1 cellSpacing=1 width="75%">
       
        <TR>
          <TD><INPUT id=radio1 name=radio1 type=radio></TD>
          <TD>Mr.</TD>
          <TD><INPUT id=radio2 name=radio2 type=radio></TD>
          <TD>Ms.</TD></TR></TABLE></P><INPUT id=text1 name=field_firstname></TD></TR>
  <TR>
    <TD>Last Name </TD>
    <TD><INPUT id=text2 name=field_lastname></TD></TR>
  <TR>
    <TD>Company </TD>
    <TD><INPUT id=text3 name=field_company></TD></TR>
  <TR>
    <TD>Street Address </TD>
    <TD><INPUT id=text4 name=field_billing_street></TD></TR>
  <TR>
    <TD>City / Town </TD>
    <TD><INPUT id=text5 name=field_billing_city></TD></TR>
  <TR>
    <TD>Country </TD>
    <TD><INPUT id=text6 name=field_billing_country></TD></TR>
  <TR>
    <TD>State / provence </TD>
    <TD><INPUT id=text7 name=field_provence></TD></TR>
  <TR>
    <TD>Zip / Postal Code </TD>
    <TD><INPUT id=text8 name=field_billing_zip></TD></TR>
  <TR>
    <TD>Phone </TD>
    <TD><INPUT id=text9 name=field_phone></TD></TR>
  <TR>
    <TD>Email </TD>
    <TD><INPUT id=text10 name=field_customer_email></TD></TR></TABLE></P>
<CENTER><LABEL
style="FONT-FAMILY: cursive; FONT-SIZE: large; FONT-STYLE: oblique; FONT-VARIANT: small-caps; FONT-WEIGHT: bold; LIST-STYLE: none inside">
<HR style="BACKGROUND-ATTACHMENT: fixed; BORDER-BOTTOM-COLOR: darkblue">
&nbsp;</LABEL></CENTER>
<CENTER><LABEL
style="FONT-FAMILY: cursive; FONT-SIZE: large; FONT-STYLE: oblique; FONT-VARIANT: small-caps; FONT-WEIGHT: bold; LIST-STYLE: none inside">Item
Information</LABEL></CENTER>
<P></P>
<P>
<TABLE align=center bgColor=skyblue border=1 cellPadding=1 cellSpacing=1
width="75%">
 
  <TR>
    <TD>Quantity</TD>
    <TD><INPUT id=text11 name=field_item_qty style="HEIGHT: 22px; WIDTH: 180px"></TD></TR>
  <TR>
    <TD>Item</TD>
    <TD><TEXTAREA id=TEXTAREA1 name=text_area_item style="HEIGHT: 57px; WIDTH: 248px"></TEXTAREA></TD></TR>
  <TR>
    <TD>Description</TD>
    <TD><TEXTAREA id=TEXTAREA2 name=text_area_description style="HEIGHT: 60px; WIDTH: 247px"></TEXTAREA></TD></TR></TABLE></P>
<HR style="BACKGROUND-ATTACHMENT: fixed; BORDER-BOTTOM-COLOR: darkblue">
<P>&nbsp;
<TABLE align=center bgColor=white border=0 cellPadding=0 cellSpacing=0
style="WIDTH: 35%" width="35%">
 
  <TR>
    <TD><INPUT id=button1 name=button1 style="FONT-SIZE: larger" type=button value=Submit></TD>
    <TD><INPUT id=reset1 name=reset1 style="FONT-SIZE: larger" type=reset value=Reset></TD></TR></TABLE></P></CENTER></FORM>
</BODY>
</HTML>





//////////////////testrespnse.asp//////////

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#INCLUDE VIRTUAL="adovbs.inc" -->
<HTML>
<HEAD>
<%
Dim MyConn, RS, RS2, strFirstName, strLastName, strUserName, strPassword
Dim first, last, company, street, city, country
Dim province, zip, phone, email, item_qty, item_name, item_description


first=request.form("field_firstname")
last=request.form("field_lastname")
company=request.form("field_company")
street=request.form("field_billing_street")
city=request.form("field_billing_city")
country=request.form("field_billing_country")
province=request.form("field_provence")
zip=request.form("field_billing_zip")
phone=request.form("field_phone")
email=request.form("field_customer_email")
item_qty=request.form("field_item_qty")
item_name=request.form("text_area_item")
item_description=request.form("text_area_description")
'grab the form contents


Set MyConn=Server.CreateObject("ADODB.Connection")
Set RS=Server.CreateObject("ADODB.RecordSet")
'since you are working with the RecordSet you need to create an instance of the RecordSet Object

Set RS2=Server.CreateObject("ADODB.RecordSet")
'in this case, since we're adding to two separate tables we need to create two instances of the RecordSet Object

MyConn.Open "DBQ="&Server.MapPath("chdata.mdb")&"Driver={Microsoft Access Driver (*.mdb)};"
'getdata is your DSN (data source name) you created in ODBC

RS.Open "Select * From tblcompanyaddress", MyConn, 3, 3
RS2.Open "Select * From tblcompanyinfo", MyConn, 3, 3
'open both RecordSets

RS.AddNew
RS("company")= company
RS("street")= street
RS("city")= city
RS("country")= country
RS("province")= province
RS("zip")= zip  
RS.Update
'Update the first RecordSet


RS2.AddNew
RS2("company")= company
RS2("contact_first_name")= first
RS2("contact_last_name")= last
RS2("contact_ph_no")= phone
RS2("contact_email")= email
RS2.Update
'Update the second RecordSet

RS.Close
RS2.Close
MyConn.Close
%>


</HEAD>
<BODY>

<P>&nbsp;</P>

</BODY>
</HTML>




/////////Getting this error message//////////

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/testresponse.asp, line 35



thanks for your time
0
 
LVL 18

Accepted Solution

by:
mgfranz earned 600 total points
ID: 2253528
there is a semi-colin missing..

Here is the correct string;

MyConn.Open "DBQ=" & Server.MapPath("chdata.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

Mark

P.S. This assumes the dB is in the same directory as the .asp file.
0
 

Author Comment

by:tparvaiz
ID: 2253553
hello mqfranz,
read you above comments:
'You can't have your string in VB with ascii characters.  take out the &amp; and replace it with just & '


Having same error

Mark
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253556
I just ran the supplied scripts with the fixes in place and it works fine on my sample dB.

Let me know if you have any other problems.

Mark
0
 

Author Comment

by:tparvaiz
ID: 2253559
hello mqfranz,
read you above comments:
'You can't have your string in VB with ascii characters.  take out the &amp; and replace it with just & '


Having same error

Mark
0
 

Author Comment

by:tparvaiz
ID: 2253563
Hi Mark,
Having same problem, may be its my server.

I am going to accept your answer but allow me to take some more time.


thanks for your time
0
 
LVL 3

Expert Comment

by:manojamin
ID: 2253565
Read THESE DOCS

1)MDACCON.EXE Using Connection Strings w/ ODBC/OLEDB/ADO/RDS
http://support.microsoft.com/support/kb/articles/Q193/3/32.ASP

2) HOWTO: Open ADO Connection and Recordset Objects
http://support.microsoft.com/support/kb/articles/Q168/3/36.asp

0
 
LVL 9

Expert Comment

by:TTom
ID: 2253570
Mark:

Does Server.MapPath provide the necessary "/" at the end of the string?

According to the code supplied by the ISP, it doesn't look like it.
================================
AdoConn.ConnectionString = "Data Source=" & Server.MapPath ("/cgi-bin/mydatabase.mdb")
================================

I'm still thinking the problem has to do with database location, either with the string or with the location of the file.

Tom
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253574
Sorry, replace the ascii character %amp; with & 

This is the EXACT string;

MyConn.Open "DBQ=" & Server.MapPath("chdata.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

Copy it exactly.  If your editor is trying to replace the & with a &amp; Get a new editor for VB Scripting.

The ; HAS to be in place.  Would you like me to give you the URL of your working example?

Mark
0
 

Author Comment

by:tparvaiz
ID: 2253591
mqfranz
Buy replacing your string, I am now having this error:

ADODB.Fields error '800a0cc1'

ADO could not find the object in the collection corresponding to the name or ordinal reference requested by the application.

/testresponse.asp, line 46
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253611
Ttom,  You may be correct with the MapPath issue.  My test dB is located in the same directory as the .asp pages on my dev server.  With the ISP suggested path to the cgi-bin, (strange place for a db..) the Server.MapPath would be like you stated;

MyConn.Open "DBQ=" & Server.MapPath("/cgi-bin/chdata.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"

This is also assuming the .asp file is located in the root dir and the cgi-bin is under root.  Where the rules on proper UNC are dictated.

E:\inetpub\wwwroot\tparviaz

Is the root web directory.  All .asp files are located here.

E:\inetpub\wwwroot\tparviaz\cgi-bin

Is where the dB is located.

Still, the fix is with the missing ;

Mark


0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253623
Data base fields are case sensitive, ensure your fields are in lower case, or modify your script to match the exact field name.

Mark
0
 

Author Comment

by:tparvaiz
ID: 2253632
My both asp, dbt files are at:

C:\inetpub\wwwroot\



Here I would like to mension that I am testing these files at my local machine but would transfer to website: hence my developing network is intranet but application has to be put on internet.

Ttom is right: my ISP suggests me to follow some specific path:

you can read ISPs specification at www.webhostme.com. It's free for ASP
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253634
One other thing, you should do some error checking on the form fields to ensure the user is not passing bad data.  i.e. type "abcde" into your 'Zip field and see what response the script gives you.

Mark

(jeez this is a lot for 115 points...)
0
 

Author Comment

by:tparvaiz
ID: 2253650
Adjusted points to 130
0
 
LVL 3

Expert Comment

by:manojamin
ID: 2253652
WOW!!! 15 more points!!
0
 

Author Comment

by:tparvaiz
ID: 2253660
Adjusted points to 150
0
 
LVL 9

Expert Comment

by:TTom
ID: 2253691
I think the ISP is suggesting that directory because it is enabled for "write", probably for purposes of form processing.  I would not do it that way, but, then again, I don't run an ISP.

Access will need to be in a directory where the web server account (IUSR_machinename) can write files (in order to create the lock file).

I sincerely doubt that the root directory will be enabled for "write" privileges.

The key to this whole thing is having a similar setup on the development machine as the production machine, or, at least, understanding the difference between the two configurations and how to deal with them.  That's why DSN's are frequently used.  As long as the DSN name is the same on both machines, you're pretty much safe that they will work.

Mark:  Nobody ever said we were in this for the money, did they <G>?

Tom
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253901
OK, so we are at least at this point;

ADODB.Fields error '800a0cc1'

ADO could not find the object in the collection corresponding to the name or ordinal reference requested by the application.

So the script is connecting to the dB, and the dB is trying to pass data but the fields are not matching the script query.  Keep the dB and the scripts in the same place for now.

This should be working fine as long as the fields in the dB match the query from the script.


Tom,  I don't know buddy... I'm just glad it's Friday. ;-)
0
 

Author Comment

by:tparvaiz
ID: 2253936
Hi Everyone.
Application is working fine, problem was of type mismatch b/w query field and database_table field.

One more thing.

Please let me know that how am I going to do put my file at my web server. I am again going to put details from ISP.


Description:
This document is provided to help you connect to your Access databases using native Microsoft Jet OLEDB provider and without an DSN.  All the information provided should be considered "as is".  No further programming support will be provided by WebHostMe other than the listing of the code here.


Sample Code for DSN-Less database connection

Begin Conn Open <BR>
<%
Set AdoConn = Server.CreateObject ("ADODB.Connection")
AdoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
AdoConn.ConnectionString = "Data Source=" & Server.MapPath ("/cgi-bin/mydatabase.mdb") 'Put the DB in cgi-bin for write access
AdoConn.Open
Set AdoConn = nothing
%>
Connection Open Complete<BR>



///////////*************

0
 
LVL 9

Expert Comment

by:TTom
ID: 2253937
Me, too!

Tom (:-}
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2253996
Place the .asp files, and the dB file in your home directory.  Thats all there is to it.

You can put the dB in any directory under your root dir as long as you have read/write permissions to it.

Mark
0
 
LVL 9

Expert Comment

by:TTom
ID: 2254158
It sounds like your ISP wants you to put the db into a cgi-bin directory under the root.  Check with them.  They should be able to tell you where it goes on THEIR server.

Tom
0
 

Author Comment

by:tparvaiz
ID: 2259518
At my home development environment, I've found that my file @ C:/inetpub/wwwroot/.asp is submiting form to my another file @ C:/inetpub/wwwroot/manager/.asp
and updating database @ C:/inetpub/wwwroot/.asp

Suggestions please
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2259611
Look at your paths in your form tags;

<FORM action=testresponse.asp id=FORM1 method=post name=FORM1>

This is assuming that the submitting form.asp page is in the same directory as testresponse.asp.

Mark
0
 

Author Comment

by:tparvaiz
ID: 2259654
OOPS,

I've found another thhing that my URL of my local server is C:/inetpub/wwwroot/manager/

i.e machine-name typed at browser leads to the above directory.

thanks
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2259695
You need to set the default directory in the WWW manager on your local server to reflect that of the ISP.

Actually, this shouldn't matter as long as all the files are located under this /manager directory.

You need to look at how your UNC is being read.  You are familiar on how ../ and ./ and / are interpreted aren't you?

If you have another question regarding another problem, please post a new question.  this one is starting to take up a lot of time and effort by a few people.  If your original answer has been corectly answered, please accept an answer.

0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question