Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Web Matrix problem

Status
Not open for further replies.

isthisthingon

IS-IT--Management
May 17, 2005
65
US
I am trying to get started using asp.net and making a web application that will access data and reports already created in an access database. I installed Web Matrix and Microsoft .net framework 1.1 and microsoft .net framework 1.1 sdk. Is there any additional software I need to install to create asp.net pages with web matrix and get them running? Thanks for all info. I have tried a connection string but got this error: type 'OleDbConnection' is not defined.

this is the code I tried using,

Dim objconnection As OleDbConnection
Dim objCommand As OleDbDataAdapter
Dim strConnect As String
Dim strCommand As String
Dim DataSet1 As New DataSet
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnect += "Data Source=c:\test.mdb;"
End Sub



 
You'll have to add an imports statement if you want to access the OleDb class directly:
Code:
Imports System.Data.OleDb


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Wow, you're quick. thanks for the reply. Where do I put that line you added?
 
I'm sorry, but that's the only code on the page that I've created. I'm an ASP.net idiot, thanks for the help.
 
In the code behind file you will see something like this:
Code:
Public Class SomeClass

Before that(on top) put this:
Code:
Imports System.Data.OleDb
 
Here's my code (asp and html):

<%@ Page Language="VB" %>
<script runat="server">
' Insert page code here
'


Dim strConnect As String
Dim strCommand As String
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnect += "Data Source=c:\test.mdb;"

</script>

<html>
<head>
</head>
<body>
<form runat="server">
<imports System.Data.Oledb>
</form>
</body>
</html>

It is saying declaration expected for the line: strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"

Thanks!!!!!!

Should I be doing this in something other than Web Matrix?
 
I don't know web matrix, I use visual studio. I'm not sure if webmatrix has code behind files???
 
Not if you are using the .NET frame work. Are you using classic asp or .NET?
 
what would you recommend to achieve my goal? I am looking to make some Microsoft Access data accessible via the web. I'd like users to be able to view reports and add and view existing data.
 
It all depends on what you can and are willing to spend. Visual Studio is not cheap, but may be the best way to go. And I would not use Access, I would use SQL Server Express. It is free.
 
Thanks, you've been so helpful. Can I use Microsoft Visual Web Developer 2005?
 
You don't have to change your IDE. To add an imports statement in your above code, add it here:
Code:
<%@ Page Language="VB" %>
[b]<%@ Import Namespace="System.Data.OleDb" %>[/b]
<script runat="server">
    ' Insert page code here
    '
...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top