473,405 Members | 2,176 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,405 software developers and data experts.

MS Access database connectivity problem

we hosted a website http://vijayawadanalanda.org
developed using asp.net and back end MS Accees database.

There is some database connectivity problem occurring when saving the information in page
url : http://vijayawadanalanda.org/feedback.aspx

getting error: Not a valid file name.

Please provide me solution to rectify this problem.

i used web.config for conndction string setting

web.config file code is
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <!-- 
  3.     Note: As an alternative to hand editing this file you can use the 
  4.     web admin tool to configure settings for your application. Use
  5.     the Website->Asp.Net Configuration option in Visual Studio.
  6.     A full list of settings and comments can be found in 
  7.     machine.config.comments usually located in 
  8.     \Windows\Microsoft.Net\Framework\v2.x\Config 
  9. -->
  10. <configuration>
  11.   <appSettings>
  12.     <add key="con" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=http://vijayawadanalanda.org/dbnalanda/nalandavja.mdb;Persist Security Info=True"/>
  13.     <add key="adminUsername" value="admin"/>
  14.     <add key="adminPassword" value="123456"/>
  15.   </appSettings>
  16.     <connectionStrings/>
  17.     <system.web>
  18.         <!-- 
  19.             Set compilation debug="true" to insert debugging 
  20.             symbols into the compiled page. Because this 
  21.             affects performance, set this value to true only 
  22.             during development.
  23.  
  24.             Visual Basic options:
  25.             Set strict="true" to disallow all data type conversions 
  26.             where data loss can occur. 
  27.             Set explicit="true" to force declaration of all variables.
  28.         -->
  29.         <compilation debug="true" strict="false" explicit="true"/>
  30.         <pages>
  31.             <namespaces>
  32.                 <clear/>
  33.                 <add namespace="System"/>
  34.                 <add namespace="System.Collections"/>
  35.                 <add namespace="System.Collections.Specialized"/>
  36.                 <add namespace="System.Configuration"/>
  37.                 <add namespace="System.Text"/>
  38.                 <add namespace="System.Text.RegularExpressions"/>
  39.                 <add namespace="System.Web"/>
  40.                 <add namespace="System.Web.Caching"/>
  41.                 <add namespace="System.Web.SessionState"/>
  42.                 <add namespace="System.Web.Security"/>
  43.                 <add namespace="System.Web.Profile"/>
  44.                 <add namespace="System.Web.UI"/>
  45.                 <add namespace="System.Web.UI.WebControls"/>
  46.                 <add namespace="System.Web.UI.WebControls.WebParts"/>
  47.                 <add namespace="System.Web.UI.HtmlControls"/>
  48.             </namespaces>
  49.         </pages>
  50.         <!--
  51.             The <authentication> section enables configuration 
  52.             of the security authentication mode used by 
  53.             ASP.NET to identify an incoming user. 
  54.         -->
  55.         <authentication mode="None"/>
  56.         <!--
  57.             The <customErrors> section enables configuration 
  58.             of what to do if/when an unhandled error occurs 
  59.             during the execution of a request. Specifically, 
  60.             it enables developers to configure html error pages 
  61.             to be displayed in place of a error stack trace.
  62.  
  63.         <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
  64.             <error statusCode="403" redirect="NoAccess.htm" />
  65.             <error statusCode="404" redirect="FileNotFound.htm" />
  66.         </customErrors>
  67.         -->
  68.         <customErrors mode="Off" defaultRedirect="errorpage.htm">
  69.             <!--<error statusCode="403" redirect="NoAccess.htm" />
  70.             <error statusCode="404" redirect="FileNotFound.htm" />-->
  71.         </customErrors>
  72.     </system.web>
  73. </configuration>
---------------------------------------------------------------------------------------

feedback.aspx.vb code is

Expand|Select|Wrap|Line Numbers
  1. Imports System.Data
  2. Imports System.Data.OleDb
  3. Imports System.Configuration
  4.  
  5.  
  6. Partial Class feedback
  7.     Inherits System.Web.UI.Page
  8.  
  9.     Dim con As New OleDbConnection(ConfigurationManager.AppSettings("con"))
  10.     Dim cmd As OleDbCommand
  11.     Dim dr As OleDbDataReader
  12.  
  13.     Protected Sub BtnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnCancel.Click
  14.         TxtName.Text = ""
  15.         TxtEmail.Text = ""
  16.         RbtRank.SelectedIndex = -1
  17.         TxtComments.Text = ""
  18.         LblResult.Text = ""
  19.  
  20.  
  21.     End Sub
  22.  
  23.     Protected Sub BtnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSubmit.Click
  24.         Try
  25.             Dim str As String = ""
  26.             str = "INSERT INTO FEEDBACK_INFO(FB_NAME,FB_EMAIL,FB_RANK,FB_COMMENTS) VALUES('" & TxtName.Text & "','" & TxtEmail.Text & "','" & RbtRank.SelectedValue & "','" & TxtComments.Text & "')"
  27.             cmd = New OleDbCommand(str, con)
  28.             cmd.Connection.Open()
  29.             cmd.ExecuteNonQuery()
  30.             cmd.Connection.Close()
  31.             LblResult.Text = "Thanks for your feedback"
  32.  
  33.         Catch ex As Exception
  34.             LblResult.Text = ex.Message()
  35.         End Try
  36.     End Sub
  37.  
  38.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  39.  
  40.     End Sub
  41. End Class
-----------------------------------------------------------------------

Thankyou for any help
Jun 4 '09 #1
6 3232
dorandoran
145 100+
Check out the link below. Notice that you must provide the actual path to the database. Contact your web hosting provider and find out the path. It's usually C or D drive then bunch of directories and subdirectories. For example,
d:\web\root\client\abc.com\ this would be your account folder and it set such a way that you cant go out of this directory. So this is the path you will have to provide in order for db to connect.

http://www.connectionstrings.com/access
Jun 4 '09 #2
Frinavale
9,735 Expert Mod 8TB
@praveenb000
No you aren't.

@praveenb000
See the <connectionStrings /> tag?
It's an empty tag!

Please take a look at this article on how to read connection strings from the Web.config file for more information on how you should storing and retrieving your connection string.
Jun 4 '09 #3
Thanks for your reply. i find the solution.

Thank you very much Lol (dorandoran,Frinavale)
Jun 4 '09 #4
dorandoran
145 100+
praveen , please post your solution so other can follow if they are having similar issue(s). thanks.
oh, glad you found the workaround.
Jun 4 '09 #5
ya, this is what i did to solve
Expand|Select|Wrap|Line Numbers
  1.  <add key="con" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=http://vijayawadanalanda.org/dbnalanda/nalandavja.mdb;Persist Security Info=True"/>
i placed my access database file in App_Data folder

and changed the data source as

Expand|Select|Wrap|Line Numbers
  1. <add key="con" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|nalandavja.mdb;Persist Security Info=True"/>
Anyway, Thanks for your team members for supporting us at any time.
Jun 6 '09 #6
dorandoran
145 100+
Glad you got it to work.
Jun 6 '09 #7

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

Similar topics

1
by: harish | last post by:
I am using java applications to connect to my MS SQL Server database. I am using ODBC for database connectivity. If i am running my java applications in a remote PC and try to connect to database...
7
by: RCS | last post by:
Okay, a rather 'interesting' situation has arisen at a place I work: I need to convert a database from Access to something that can be used over the web. I am currently maintaining and...
10
by: MHenry | last post by:
Hi, We were going merrily along for 6 years using this database to record all client checks that came into our office, including information about what the checks were for. Suddenly, network...
9
by: Tony Lee | last post by:
Some time a ago, on this newsgroup the following comments were made in recommending good references for Access (2003) >I used to recommend Dr. Rick Dobson's, "Programming Access <version>" for...
10
by: Preston Crawford | last post by:
I'm looking to learn ASP.NET better and thinking about helping my church put together a website in order to do this. They need the help, I'd like the training, so I'm thinking of going this route...
5
by: Nathan Given | last post by:
Hello All, I've been struggling on and off for 3 months trying to connect to an DB2 database running on an IBM iSeries machine. I FINALLY figured out how to connect with Coldfusion (see...
1
by: Michael | last post by:
Hello, I am trying to develop a database solution for an organisation in Indonesia. This organization has a number of offices and users throughout the country. They all need to maintain their...
0
by: raylopez99 | last post by:
10 years ago, the below was written (see very end, after my signature RL). What, if anything, has changed? I have Access 2003 and soon Access 2007 on a Windows XP Professional or Windows...
0
by: justSteve | last post by:
I'm working with a .sln that has 2 projects...one has db connectivity, the other is intended to call methods of the db-connected project. This isn't a formal 'DAL' situation but it's along those...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.