473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Errors testing sample pages

Hi there

I wasnt sure if access was the right section to post but seeing as thats what im working on here goes.

I spent some time on W3schools web however almost all of the samples I copied and pasted gave me the same/similair error:

Microsoft VBScript compilation error '800a0401'
Expected end of statement
/test/demo_update.asp, line 15

Sample Code:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body><%
  3. set conn=Server.CreateObject("ADODB.Connection")
  4. conn.Provider="Microsoft.Jet.OLEDB.4.0"
  5. conn.Open "c:/inetpub/wwwroot/test/fpdb/mytest.mdb"
  6. set rs = Server.CreateObject("ADODB.recordset")
  7. rs.Open "SELECT Companyname, Contactname FROM Customers", connstr=rs.GetString(,,"</td><td>","</td></tr><tr><td>","&nbsp;")
  8. %><table border="1" width="100%">
  9.   <tr>
  10.     <td><%Response.Write(str)%></td>
  11.   </tr>
  12. </table><%
  13. rs.close
  14. conn.close
  15. set rs = Nothingset conn = Nothing%></body>
  16. </html>


Now seeing as these are samples I would assume they actually work, is there something happening on my 2003 Server or is there a language code difference that needs to be applied for using MS Access ?

Many thanks
May 16 '07 #1
2 1301
puppydogbuddy
1,923 Expert 1GB
It sounds to me like you need to set a VB Library reference to Microsoft VB Script. Go into the VB code editor for the application. Select Tools > References from the Access command menu and look to see if it shows any references as being "Missing". If it does show a missing reference, then scroll down the alphabetical list; when you see the link referred to as missing, place a checkmark in the checkbox on the left and select ok.

Hope this helps.
May 16 '07 #2
Denburt
1,356 Expert 1GB
Since it is a compilation error check for the missing references as dog suggested but also compile it. In the MS Access window go to the debug menu then click compile and see if you have any errors there.

Next I saw the following statement and I don't see how this could work.

conn.Open "c:/inetpub/wwwroot/test/fpdb/mytest.mdb"

The statement "c:/inetpub/wwwroot/" tells me that it is in a web server folder and hopefully you are set up to run an asp page. If this is the case then your connection should look a little more like the following.

Expand|Select|Wrap|Line Numbers
  1.     cst = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
  2.         "Data Source=" & Server.MapPath("/test/fpdb/mytest.mdb>") 
  3.  
  4.     set conn = CreateObject("ADODB.Connection") 
  5.     conn.open cst 

Now seeing as these are samples I would assume they actually work

Welcome to the real world, I would say about 95 percent of the samples you find on the net will have something left out. It won't always cause an error but with out it you will have sloppy coding practices. I used to get really frustrated when I didn't understand the concepts but I think most experienced programmers are willing to help but they want you to learn also. Most of my knowledge came from rooting around trying to fix the stupid error from the samples, helpfiles etc. I found out so much from doing it this way it really has helped me in the long run.

Let us know how it goes.
May 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Russ | last post by:
Hello. My new dev machine is running XP Pro. In the past all equipment has only used Windows 2000. I have had a lot of problems getting my projects up and running on the new machine. The current...
0
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and...
7
by: Holger (David) Wagner | last post by:
Hi Group, I've searched the Web for precompilers that compile ASPX/ASCX pages just like it can be done with JSPs, but so far, I've only found approaches targetted at increasing the performance....
3
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a...
7
by: cpnet | last post by:
I'm trying to stress-test some controls I've built in a sample web app using ACT. I'm now using IIS on my SBS 2k3 machine as my webserver for the test, and ACT is running on my XP Pro (sp1)...
0
by: Ravi Chand via .NET 247 | last post by:
(Type your message here) Hi All, One of our ASP.Net application was stress tested recently andunfortunately it is throwing up intermittent errors. Theapplication has been setup in a load...
11
by: z | last post by:
How can validation testing on DBMSs such as DB2 and Oracle be performed? Is there a quick commonly used publicly available DBMS test that can be used? Could TPC-C be used? If so, where can...
5
by: Mike Hofer | last post by:
I need some advice, folks, and I'm hoping you can provide it. First off, a few disclaimers: 1.) I am an ardant advocate of code quality. Especially, my own. 2.) I am maintaining a massive...
1
by: flashadow | last post by:
Who can explain. Can JsUnit test dynamic pages? A site uses Apache Tomcat for the start. A site consists of starting page in which is loaded 4 jsp pages. Functions that need testing take...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.