rs.setDatabase("SAM,1433","CCPoSRestaurant","sa","96241822726890838")
rs.Query("Select * From Login where Password = '" & txtPin.Text & "'")
Msgbox(rs.TableList,"")
If LastException.IsInitialized=False Then
Msgbox("Invalid Pin","")
Else
For i = 0 To lv.Size
Msgbox(lv.Get(i),"")
Next
i NEED TO CHECK WHETHER THE ABOVE CODING IS CORRECT FOR SEARCH PASSWORD.
Thanks for the Reply.
I have typed the Code
Dim cnt As Int
rs.setDatabase("SAM,1433","CCPoSRestaurant","sa","96241822725842541")
cnt = rs.Query("SELECT COUNT FROM Login WHERE password = '" & txtPin.Text & "'")
Msgbox(cnt,"")
But I am not getting the Message Box . Please Advice.
The above tutorial use to open the db file, but my Database is on Server Sam.1433. And I got stuck on Line
cnt=rs.query("SELECT COUNT ....
Please Help ....
You can not connect to a remote database using the sql object. It is only for connecting to a sqlite database on the device.
To connect to a remote database you need to setup an RDC (Remote DatabaseConnector). jRDC2 is the newest release.
Search the forum for jRDC2
It is a B4J app which you must run on your server. See the RDC tutorial onn how to connect to your RDC and get data from your DB.
I think he is using the MSSQL library located here. I'm just guessing though, since not a lot of info is given by the originating author. If that's the case, the first post on the library page has the following code fragment:
B4X:
db = setDatabase("Server IPNUMBER (not name)","databasename","username","password")