Problem with Connection String
-
Hi Frnds.. I hv developed a Bill Contract Software in Vb.Net 2005(Windows application) , using vb as a language and msaccess as backend. I want to store all the data in the server. So i hv copied msaccess file to my personal domain inside wwwroot folder. Now i dont want to store data in my PC. It should be stored in the server directly. Can anyone tell me what is the connection string for that... Thank you...
-
Hi Frnds.. I hv developed a Bill Contract Software in Vb.Net 2005(Windows application) , using vb as a language and msaccess as backend. I want to store all the data in the server. So i hv copied msaccess file to my personal domain inside wwwroot folder. Now i dont want to store data in my PC. It should be stored in the server directly. Can anyone tell me what is the connection string for that... Thank you...
Yes, it's a path to the mdb, across the network to the server machine.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Yes, it's a path to the mdb, across the network to the server machine.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
hi try looking in here...http://www.carlprothman.net/Default.aspx?tabid=81
-
hi, simply create a log file, which store the path of your database. Let me explain first of all , make a form which ask from user for database path and set this form as startup form. Now at load event of this form check whether logfile(path.txt) is exist or not and perform action according to condition. I use following code in most appliction
If File.Exists(Application.StartupPath & "\Path.txt") Then FileClose(1) Dim s As String FileOpen(1, "path.txt", OpenMode.Input) Input(1, s) Dim FilePath As String FilePath = s TextBoxSetDatabasePath.Text = FilePath If File.Exists(FilePath) Then FilePath = FilePath.Substring(FilePath.LastIndexOf("\") + 1) If FilePath.Trim.ToUpper = "YOURDATABASENAME.MDB" Then DatabasePath = TextBoxSetDatabasePath.Text.Trim ' DatabasePath is global variable LoginForm1.Show() Me.Close() Else msgbox("Wrong database file. Please choose correct database file") End If Else msgbox(("Database file not found. Please choose the database file.") End If Else mdChecking.Prompt("Database Path not set. Please choose Database file.") End If
use databasepath varible value in connectionstring. for prompt user to pick correct database file use following procedureTry If TextBoxSetDatabasePath.Text <> "" Then If Not File.Exists(TextBoxSetDatabasePath.Text.Trim) Then mdChecking.Prompt("Incorrect database file. Please choose correct database file") Exit Sub Else Dim FilePath As String = TextBoxSetDatabasePath.Text.Trim FilePath = FilePath.Substring(FilePath.LastIndexOf("\") + 1) If FilePath.Trim.ToUpper = ""YOURDATABASENAME.MDB".MDB" Then DatabasePath = FilePath.Trim 'If File.Exists(Application.StartupPath & "\path.txt") Then ' File.Delete(Application.StartupPath & "\path.txt") 'End If Dim s As String FileClose(1) s = Application.StartupPath & "\path.txt" FileOpen(1, s, OpenMode.Output)
-
Well, you have a small problem. You can't connect to an Access database on the other side of a web server. Access is a file-based desktop database, not an SQL Server. It will only work if the user running your app can see the database file through a Windows Share, AND the user has read and write access to that share. Normally, noone gets those kind of permissions if the file is in the wwwroot folder or below.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Well, you have a small problem. You can't connect to an Access database on the other side of a web server. Access is a file-based desktop database, not an SQL Server. It will only work if the user running your app can see the database file through a Windows Share, AND the user has read and write access to that share. Normally, noone gets those kind of permissions if the file is in the wwwroot folder or below.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008