Google Answers Logo
View Question
 
Q: Publishing An Access Database On Internet ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Publishing An Access Database On Internet
Category: Computers
Asked by: marrett88-ga
List Price: $50.00
Posted: 22 Jan 2003 05:12 PST
Expires: 21 Feb 2003 05:12 PST
Question ID: 146912
I am interested in creating a database using MS Access 2002 with the
objective of creating web pages for data entry, generate reports to
view the live data and publish on the IIS server so as to be accessed
over Internet.


I have used Data Access Pages to do Data Entry, which writes to a
database. Whenever we are accessing the Data Entry pages over Internet
we receive a Blank Message Box as error. However this works fine on
Intranet(LAN ) but not on the Internet .



Would like to know how to connect to a remote database over Internet
using the Data Access Pages.



Have attempted the following but have not been successful : 



1. In the data Pages Properties we have set the "UseRemoteProvider =
True"

2. On the IIS Server Granted Access to RDS -Based pages and
Applications under Directory Security\IP Address and Domain Name
Restrictions\Edit\IP Address and Domain Name Restrictions\Granted
Access

3. Have executed the C:\Program Files\Common
Files\System\msadc\handsafe.reg registry file and added the

[connect C:\inetpub\wwwroot\Data\MyDB.mdb]
Access=ReadWrite 

to the MSDFMAP.ini file .
Answer  
Subject: Re: Publishing An Access Database On Internet
Answered By: theta-ga on 22 Jan 2003 09:55 PST
Rated:5 out of 5 stars
 
Hi marrett88-ga,
   For deploying Data Access pages over the Internet, you have to
configure your setting to support 3 tier data access. Also, a lot of
configuration has to be done on the webserver on which the pages and
the database reside.
   The following MS KnowledgeBase Article provides step by step
instructions on how you can do this :
    - Article 291783: How to Deploy Data Access Pages over the
Internet
      ( http://support.microsoft.com/default.aspx?scid=KB;en-us;q291783
)

  You can find a comprehensive instructions and an in-depth discussion
on this topic in the following (40 page!) MSDN Library Article :
    - MSDN Library: Deploying Data Access Pages on the Internet or
Your Intranet
      by Mark Roberts
      ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k2/html/deploydap.asp
)
      This article is a must read for anyone thinking of deploying
DAPs over the Internet.

==================================================

In your case, I recommend that you reconfigure your setting following
the step by step guidelines provided in the MS KnowledgeBase
Article(linked above).

From the information you have provided, it appears that you have setup
the Remote Data Services(RDS) correctly. However, you make no
references to whether you have configured Folder and File permissions
and Anonymous Access on the webserver or not. Please configure your
settings as per the MSKB article and tell me if it works or not.

Another thing you need to be aware of, are the software requirements
for the computer on which you want to view these Data Access Pages.
The client machine needs to have the following installed :
  - Microsoft Internet Explorer 5 or later 
  - Microsoft Office Web Components (for pages created with Access
2000)
  - Microsoft Office XP Web Components (for pages created with Access
2002). To find out more about them, check out the following MSKB
Article :
               - Article 288729: General Information About Licensing
and Using Office XP Web Components
               ( http://support.microsoft.com/default.aspx?scid=kb;EN-US;288729
)

Also make sure that your webserver( which hosts the DAP pages) and
your database server(which hosts the database) meet the following
requirements :
Web Server Requirements: 
    - Microsoft Internet Information Server 4.0 or later 
    - Microsoft Data Access Components (MDAC) 2.1 or later (for pages
created with Access 2000)
    - Microsoft Data Access Components (MDAC) 2.5 or later (for pages
created with Access 2002)

Database Server Requirements: 
    - Microsoft Jet Database Engine 4.0—for pages that use three-tier
data access to work with data stored in an Access back-end database
(.mdb).
    - Microsoft SQL Server 6.5 or later—for pages that use data stored
in a SQL Server backend database.

For more information on the above requirements, I highly recommend
that you check out the MSDN Library Article linked above.
=================================================

Hope this helps.
If you need any clarifications, just ask!

Regards,
Theta-ga


=================================================
Google/Google Groups Search Terms Used :
    "data access pages" error blank fields over the internet
    "Data Access Pages" blank message box error internet
    "Data Access Pages" work on Intranet update remote database over
internet

Request for Answer Clarification by marrett88-ga on 24 Jan 2003 07:26 PST
Hi 
The data entry forms appears on theInternet.However, the Navigation
bar is disabled.
I have followed all the points mentioned in the articles referred.

What else needs to be done ?

Clarification of Answer by theta-ga on 24 Jan 2003 08:52 PST
Hi marrett88-ga,
   Glad to know that you were able to get the page on the Internet. 
:-)

   Now lets tackle the latest problem. I visited your test page, but
since the machine I am working on does not have the Office XP Web
Components installed, I was unable to test it out. I am currently
downloading the Web Components from Microsoft's website, and will try
out your page once I have them installed.
  
   An idea you can check out in the meantime, is to check whether the
client computer from which you are viewing the page, has Office XP
installed on it or not. From the Office XP Web Components Deployment
Guide :
   "By default, if a user does not have Office XP, Access 2002, Excel
2002, or FrontPage 2002 installed on their computer, and the user
installs the Office Web Components, the user receives a Run-time
Static license for the Office XP Web Components. This means the user
can view the controls on a Web page but cannot interact with the
controls."
   Apparently, if the user only has a Run-time Static licence, he/she
can only use the About and Help buttons on the component toolbar and
the rest are disabled. You can read more information on this problem
and its work around from :
     - Article 288732: Deploy the Office XP Web Components in an
Office Program
       ( http://support.microsoft.com/default.aspx?scid=kb;EN-US;288732
)

Hope this helps.
I will check out your test page as soon as I can, and post any new
clarification here.

Regards,
Theta-ga

====================================

  Something you should be aware of : The original version (pre SP2) of
the Office XP Web Components contain three security vulnerabilities.
Since you are deploying these controls on the Internet, you might want
to upgrade to the updated versions of the Web Components.
  For more information :
          - Microsoft Security Bulletin MS02-044
            ( http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/MS02-044.asp
)

  You can download the updated components from :
          - Office XP Tool: Web Components
            ( http://office.microsoft.com/downloads/2002/owc10.aspx )

Request for Answer Clarification by marrett88-ga on 25 Jan 2003 08:07 PST
Hi again

    We doing the work using a subscription based MSDN , so we have a
licensed Office XP on the client system. However, we still cant get
the Navigation bar to work !!

Clarification of Answer by theta-ga on 25 Jan 2003 10:13 PST
Hi marrett88-ga,
   Seems to be a database access problem. Please check that you have
the required permissions to add a new record to the database.
   In your test() function, check if the value of
MSODSC.Currentsection is objTest is null before you try to use it.

Regards,
theta-ga

Clarification of Answer by theta-ga on 25 Jan 2003 11:12 PST
Hi marrett88-ga, 
     I need you to clarify exactly what happens when you load up your
test page. The following is my experience :
      - After installing the Office XP Web components, I loaded your
test page.
        > A messagebox appears with the text "Testing..."
        > After clicking Ok, another message box appears with the text
"Error Object required". These messages of course, are due to the code
in your test() function.
        > Now the page appears. All the textboxes are empty. The
navigation bar items are NOT grayed out. They are all present, but
nothing happens on clicking them.
        > When I click on the Add Record button, I get an empty
message box, with just the Ok button.

   This is what I saw initially on your page. Just to make sure that
the problem was not caused due to MDAC errors, I downloaded and
installed MDAC 2.5 SP3 (2.53.6200.2) from :
           - Microsoft Universal Data Access Download Page
             ( http://www.microsoft.com/data/download_25SP3.htm )

After the install and reboot, when I went to your page, this is what I
saw :
        > A messagebox appears with the text "Testing..."
        > After clicking Ok, another message box appears with the text
"Error Data connection does not exist...". These messages of course,
are due to the code in your test() function.
       > Now the page appears. All the textboxes are filled with the
string '#Name'. The navigation bar items ARE grayed out(except the
help button).
       > When I click on the Add Record button, I get a message box,
saying that since the recordset is set to readonly, I cannot add a new
record.

    As you can guess, I was pretty surprised by the changes in the
page caused by the MDAC installation. Suspecting that the previous
installation had gone bad, I re-ran the MDAc 2.5 SP3 installation
again and rebooted.
    The page now returned to the initial view as detailed at the
begining. After multiple reboots, the page has remained the same, so
this page is what I am working on.
    This is why it becomes necessary for you to detail what exactly
your clients see when they load this page and what messages they
receive, so I know that we are trying to solve the same problems. You
might also what to check the MDAC installations on your client
machines.
    
Regards,
theta-ga
:)

Clarification of Answer by theta-ga on 26 Jan 2003 06:23 PST
Hi marrett88-ga,
   The Object required error in your page can be fixed by changing
your test() function. In it, you need to use the Set statement inorder
to assign the reference to the MSODSC.DataPage object. The assignment
becomes :
     Set <variable> = MSODSC.<object name>

Also, try to find out that when we click Add Record, which line of
code throws the error. You can do this by inserting message boxes
above the lines of code.

 Please try out the above suggestions and tell me the results. Also,
as detailed in my last posting, please tell me in exact detail, what
you see when you load your test page on the client machine.
Regards,
Theta-ga

Clarification of Answer by theta-ga on 26 Jan 2003 11:21 PST
Hi marrett88-ga,
     Here is the code for your test() function that will give the
required results:
       function test()
	on error goto catcherror
		msgbox "testing..."
	 dim objTest
	 set objTest=MSODSC.Currentsection
	 objTest.Datapage.NewRecord()
	
	exit function
	
	carcherror:
	msgbox "error" & err.Description
	
end function

Then in the code for the onclick event, in the catch block, add the
error number also. The code becomes :
   <SCRIPT event=onclick for=Command0 language=javascript>
try { if (MSODSC.CurrentSection == null)
	MSODSC.DataPages(0).NewRecord();
else
	MSODSC.CurrentSection.DataPage.NewRecord(); }
catch (e)
{ alert (e.number + " Description: " + e.description);}
</SCRIPT>

Also, find out whether MSODSC.CurrentSection is null or not, when this
code executes.
Regards,
Theta-ga

Clarification of Answer by theta-ga on 27 Jan 2003 11:32 PST
Hi marrett88-ga,
     You might also try to remove the line
                 objTest.Datapage.NewRecord() 
from your test() function to see if it solves the error caused when we
click on the Add Record button.
      Another thing to check is your database. Check that you have
vreated the required table with the relevant fields. MAKE SURE that
you have defined one of the fields as the Primary Key. Which field is
the Primary Key? Is the primary key autogenerated or does it have to
be entered by the user?
Awaiting your replies.
Regards,
Theta-ga

Request for Answer Clarification by marrett88-ga on 28 Jan 2003 06:59 PST
Hi

 Thanks for the support so far.

 The replies to the recent points are :

1. Set” keyword has been used to assign the object to the variable.

When the “Add Record” button is clicked the line which causes error is
	MSODSC.CurrentSection.DataPage.NewRecord()


2. The vbscript code supplied  is not working, The line “on error goto
catcherror”  is causing a syntax error.

I  have inserted code (Javascript) to display the error code and the
code returned was -2147418113

In the script (JavaScript) for onClick “MSODSC.Currentsection”  is not
Null. Have inserted message boxes to make this clear.


3.objTest.Datapage.NewRecord() has been removed from the test()
function. This didn’t have any effect on the error caused by the Add
Record button

Database has a Primary Key and it is Auto number and is auto
generated. The Primary key field is Invoice Detail ID.


Regards

Clarification of Answer by theta-ga on 29 Jan 2003 06:56 PST
Hi marrett88-ga, 
   Well, I'm back with my latest round of suggestions and questions.
   :-)
   - In your very first request for clarification you had said that
your navigation bar was disabled. Are the buttons grayed out? Or are
they normal but simply not working?

   - You might want to try providing a downloadable licence for the
Office Web Components on your page. The steps are detailed here :
          - Deploy the Office XP Web Components: Licensing
          ( http://support.microsoft.com/default.aspx?scid=kb;EN-US;288732#6
)

   - According to the MSDN Library, the NewRecord method fails if the
recordset cannot be updated. So, add the following code to your page,
instead of the current JavaScript code that fires on the onclick event
of Command0 button :
********** Begin Code ************
<script=event=onclick for=Command0 language=vbscript>
  
   Dim strDBName, numRec
   On Error Resume Next   

  ' Database we are connected to
  strDBName = GetConnectedDatabase

  ' Number of records in the database
  numRec = MSODSC.CurrentSection.DataPage.Recordset.RecordCount

  ' Is current section Updateable ?
  if SectionIsUpdateable(MSODSC.CurrentSection) = True then
     strUpdate = "Can be Updated"
  else
     strUpdate = "Cannot be updated."
  endif

  ' Display results
  MsgBox " Database : " & strDBName & vbcrlf _
          & " Number Of Records : " & numRec _
          & " Is Updateable? : " & strUpdate

  ' Handle Any Errors
  If Err.Number <> 0 Then
    MsgBox "The following Error has occured:" & vbcrlf _
           "Number: " & Err.Number & vbcrlf _
           "Description: " & Err.Description & vbcrlf _
           "Source: " & Err.Source 
    Err.Clear
  End If  

  ' try to add new record
  MSODSC.CurrentSection.DataPage.NewRecord

  ' Check for errors
  If Err.Number <> 0 Then
    MsgBox "The following Error occured on NewRecord:" & vbcrlf _
           "Number: " & Err.Number & vbcrlf _
           "Description: " & Err.Description & vbcrlf _
           "Source: " & Err.Source 
    Err.Clear
  End If 

</script>

<script language=vbscript>

 Sub SectionIsUpdateable(theSection)
    SectionIsUpdateable = False
    On Error Resume Next

    ' Banded pages aren't updateable.
    If (MSODSC.GroupLevels(0).DataPageSize > 1) or _
       (MSODSC.GroupLevels.count > 1) Then
         MsgBox "Banded Pages are not updateable."
         Exit Sub
    endif

    ' Now check if recordset itself is updateable.
    Set rs = theSection.DataPage.Recordset
    If Err.Number <> 0 Then
       MsgBox "The following Error has occured on set rs:" & vbcrlf _
           "Number: " & Err.Number & vbcrlf _
           "Description: " & Err.Description & vbcrlf _
           "Source: " & Err.Source 
       Err.Clear
       Exit Sub
    end if

    If Not rs.Supports(adUpdate) Then
       MsgBox "Recordset does not support Updating!!"
       Exit Sub
    End If

    If rs.Properties("Unique Table") = "" Then
       MsgBox "No UniQue table!!"
       Exit Sub
    End If

    ' Catch assorted errors
    If Err.Number <> 0 Then
       MsgBox "The following Error has occured :" & vbcrlf _
           "Number: " & Err.Number & vbcrlf _
           "Description: " & Err.Description & vbcrlf _
           "Source: " & Err.Source 
       Err.Clear
       Exit Sub
    end if
   
    SectionIsUpdateable = True
End Sub
</script>
********* End Code **********

Another thing you should test is whether you can read, update and
insert records into the database using SQL and ADO, as shown on the
following article :
          - MSDN Library: Programming Data Access Pages
            ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/programdap.asp
)

Look at the 'Dealing with Data' section to see what I mean.

Hope this helps.
Regards,
Theta-ga

Request for Answer Clarification by marrett88-ga on 31 Jan 2003 05:56 PST
Hi 

We made som registry entries and things are working now

Thanks for all the support

Clarification of Answer by theta-ga on 31 Jan 2003 08:22 PST
Hi marrett88-ga,
    Glad that you finally got it working! :-)
    Thank you for using Google Answers.
Regards,
Theta-ga
marrett88-ga rated this answer:5 out of 5 stars

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy