Hi with the SQL Tutorial and the MySQL example I was successful in making a connection to a remote SqlServer Database that resides on a remote Web Hosting Site!! So Exciting. Below is the Code in the Main Module. The table gets created properly. So I know I am connected.... Half the battle. I used the SQL Server JDBC driver downloaded from Microsoft. Additional questions follow code.
'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#AdditionalJar: sqljdbc4.jar
#End Region
Sub Process_Globals
Public srvr As Server
Private sql1 As SQL
End Sub
Sub AppStart (Args() As String)
srvr.Initialize("srvr")
srvr.AddWebSocket("/ws", "HelloWorld")
srvr.Port = 51042
srvr.Start
sql1.Initialize("com.microsoft.sqlserver.jdbc.SQLServerDriver","jdbc:sqlserver://mssql502.ixwebhosting.com;DataBaseName=****;user=*****;password=****")
sql1.ExecNonQuery("CREATE TABLE Test1 (col1 TEXT, col2 INTEGER, col3 INTEGER)")
StartMessageLoop
End Sub
So I based this on the simple HelloWorldWebApp. I have the complete project also attached.
My new questions now are these. What I want to do is add 3 simple text boxes to the Index.html file and also a button. When I click on the button I want to execute a query that inserts the data from the text boxes into the table that was created. I am not sure how to make the sql1 Variable Global so that it can be accessed in the HelloWorld Module. It is not recognized as I currently have it. I tried to move the sql1 variable declaration and create query command to the HelloWorld module but it did not work there.
Please give me some guidance on what to do next. I feel I am very close. Thank you....
'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#AdditionalJar: sqljdbc4.jar
#End Region
Sub Process_Globals
Public srvr As Server
Private sql1 As SQL
End Sub
Sub AppStart (Args() As String)
srvr.Initialize("srvr")
srvr.AddWebSocket("/ws", "HelloWorld")
srvr.Port = 51042
srvr.Start
sql1.Initialize("com.microsoft.sqlserver.jdbc.SQLServerDriver","jdbc:sqlserver://mssql502.ixwebhosting.com;DataBaseName=****;user=*****;password=****")
sql1.ExecNonQuery("CREATE TABLE Test1 (col1 TEXT, col2 INTEGER, col3 INTEGER)")
StartMessageLoop
End Sub
So I based this on the simple HelloWorldWebApp. I have the complete project also attached.
My new questions now are these. What I want to do is add 3 simple text boxes to the Index.html file and also a button. When I click on the button I want to execute a query that inserts the data from the text boxes into the table that was created. I am not sure how to make the sql1 Variable Global so that it can be accessed in the HelloWorld Module. It is not recognized as I currently have it. I tried to move the sql1 variable declaration and create query command to the HelloWorld module but it did not work there.
Please give me some guidance on what to do next. I feel I am very close. Thank you....