Visual Basic .NET Forums    

Go Back   Visual Basic .NET Forums > ASP.NET > ASP.NET General Discussion

VB.NET Forums Newsletter Signup:
Email address:


ASP.NET General Discussion General discussion on ASP.NET development with VB.NET

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2008, 12:37 PM
VB.NET Forum Newbie
.NET Framework: .NET 1.1 (VS 2003)
 
Join Date: Jun 2008
Posts: 1
Reputation: 0
emadmilan is on a distinguished programming path ahead
Default Database not found

hi


when i try to connect to my database which is MS Access file i get this error
Could not find file 'C:\Users\Emad N. Alrwaily\Desktop\Sorting\Projects\WebSite1\MyDataB ase.mdb'

and this hapen to my i put the connection string like this
Code:
Dim StrCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyDataBase.mdb;"
but when i put the full path of the database directory it work like this
Code:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Emad N. Alrwaily\Desktop\Sorting\WebSites\WebSite1\MyDataBase.mdb;"
please help
Reply With Quote
  #2 (permalink)  
Old 12-02-2008, 2:19 PM
arjmand's Avatar
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Aug 2006
Posts: 29
Reputation: 32
arjmand is on a distinguished programming path ahead
Default Hi

Not sure, but try "..\", like this

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\MyDataBase.mdb;"
Reply With Quote
  #3 (permalink)  
Old 12-02-2008, 8:32 PM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 36
Posts: 8,138
Reputation: 876
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

server.mappath() is used in this sample: ASP.NET Database Connection
__________________
See this thread about how to use forum markup codes for code blocks etc (present the problem/post properly )
Some useful links: Learning videoes, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ


DR. WEIR: Download it to a non-networked, firewalled computer.
TECHNICIAN: Yes, ma'am.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 7:09 AM.




Click to advertise here

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
For advertising opportunities click here.