View Full Version : Web Matrix - Data Connection
comblitz
02-07-2003, 06:43 AM
Hi. I've installed Web Matrix on my PC and have tabbed to the data tab. In there, I can create a new connection. I want to connect to the .mdb file I've created on the web server. The first question it asks is server:_____________
What is the server supposed to be? Am I not supposed to be able to connect from my PC? Any help is appreciated.
Thanks,
Ron
davidseye
02-10-2003, 03:52 AM
I am not an expert on Web Matrix, but from the little I have worked with it, I don't believe you can establish and data connection on the data tab to an Access (*.mdb) database. The wizard, when I looked at it, was for SQL or MSDE(built on the SQL engine) database. What I have done is set up a connection in my web.config file in the root of site on the server.
<configuration>
<appSettings>
<add key="connAccessDB" value="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=e:\web\path to your access db.mdb;" />
</appSettings>
</configuration>
Then, in your page you can call this connection:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">
sub Page_Load(sender as Object, e as EventArgs)
'Open a connection
Dim objConnection as OleDbConnection = New OleDbConnection(ConfigurationSettings.AppSettings("connAccessDB"))
objConnection.Open()
etc. etc.
end sub
</script>
This works for me. Let me know if you have problems.
bruce
02-10-2003, 10:22 AM
The Database wizard comes with web matrix only works for SQL server. I don't believe it will work with MS Access.
The best place on earth to learn how to use matrix is at
http://www.asp.net/webmatrix/tour/getstarted/intro.aspx
[b]quote:Originally posted by comblitz
Hi. I've installed Web Matrix on my PC and have tabbed to the data tab. In there, I can create a new connection. I want to connect to the .mdb file I've created on the web server. The first question it asks is server:_____________
What is the server supposed to be? Am I not supposed to be able to connect from my PC? Any help is appreciated.
Thanks,
Ron
</blockquote id="quote"></font id="quote">
vBulletin® ©Jelsoft Enterprises Ltd.