Visual Basic .NET Forums  

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

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

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-02-2008, 11:37 AM
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-02-2008, 1:19 PM
arjmand's Avatar
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Aug 2006
Posts: 29
Reputation: 38
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;"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-02-2008, 7: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: 9,160
Reputation: 1079
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
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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 11:51 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0


For advertising opportunities click here.