simple web example project with db connection


I’m trying to start my first web-edition project, but I can’t find simple example project (this eddies electronics is way too complicated for me).
I need to build simple client registry to MSSQL server. Web server is Centos.
Main problem is that I don’t know how to define database connection.

Create a db property under Session. This creates a new db connection for every user of your app.
Then to connect, simply use the code below. Also, take a look in the LR :slight_smile:

Hope it’s enough to get you started! :slight_smile:

db = New MSSQLServerDatabase

db.Host = "\\InstanceName"  // or just the IP if using the default instance
db.DatabaseName = "NorthWind"
db.UserName = "MyUserID"  // or "Domain\\UserID for trusted domain accounts
db.Password = "mypassword"

If db.Connect Then
  //proceed with database operations
  MsgBox("Connection error:" + db.ErrorMessage)
End If