So I have a database (for tracking customer applications through to approval etc.) in MS Access form & and all (but access just isnt the best way to do this for many reasons I wont get into).
I have looked at lots of programming language and decide that VB was best since i am somewhat familiar with it (from VBA). I added a new data source and did a form but now i realized that this make a copy of my existing database and saved in the project folder. This is not what i wanted. I wanted it to connect to and use the existing on that I have on a server. I need ppl from different branches to access this be and thus cannot have it on my computer. I was wondering if after i have published this program will the file get information from the server or continue from this file? and if not (get from the server) how do I make it use only that file on the server. I have created a login form that i know connects to the server. Below is the code that I use for that form. Is there away to get the data source to only the one from the server or will i have to do something like below?
Imports System.Data.OleDb
Public Class CTSLoginForm
' OK button
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Atlanet\loantracking\CTS_be.mdb")
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM MSysUserList WHERE Username = '" & usernametextbox.Text & "' AND Password = '" & passwordtextbox.Text & "' ", con)
con.Open()
Dim sdr As OleDbDataReader = cmd.ExecuteReader()
' If the record can be queried, Pass verification and open another form.
If (sdr.Read() = True) Then
MessageBox.Show("The user is valid!")
Dim MainForm As New CreditTrackingSystemPARENT
MainForm.Show()
Me.Hide()
Else
MessageBox.Show("Invalid username or password!")
End If
End Sub
' Cancel button
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
End Class