Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB accessing remote SQL tables

Status
Not open for further replies.

brianf51

IS-IT--Management
Mar 11, 2003
6
0
0
GB
Hi and please bear with me, I do programme but am not a programmer by trade (just a jobber).

I have a project where I require users to activate software installed on their PC's against MySQL tables on a web server.

I'm assuming that especially because of Vista, the actual registry updates on the PC will have to be performed by an app on the PC rather than by an ASP from the web server.

If that is the case, can a VB2005 app on the PC access and update the MySQL tables on the webserver?

Thanks guys

Brian
 
Yes.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Great comeback, wouldn't care to elaborate would you?
 
Not really.

"If that is the case, can a VB2005 app on the PC access and update the MySQL tables on the webserver?"
Yes.

You asked a simple yes/no question. If you need more details be more specific. If I'm coming off rude I don't mean to be, but what more do you want? How you actually do it is what making a program is. If you have problems when you start making your program or you get errors then I could give more info. If you need a full program made you came to the wrong forum.

If your asking about what resources you need I couldn't really tell you much. Program wise just VB.NET. If you have never programmed then they have a step-by-step on MSDN for making a simple program.

Again, I don't know what more you are asking so you need to elaborate. Otherwise the answer is yes.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Maybe I should have been a bit more specific and if I'd wanted the entire program I think I would have asked!

What I'm looking for is guidance on the principles of connecting to the web server to access the tables. I can programme in VB and SQL but exactly how to connect is new territory

 
Ok, that makes more sense. I'm still more partial to the old way (ADODB) than ADO.NET. Only because I've been doing it for so long. MSDN has some examples. They use to have some videos as well. There are several that hang around here that could likely explain more (and better), but I'll give you a basic one and it might point you in the right direction.

requires Imports System.Data.SqlClient
Code:
Dim Conn As SqlConnection
Dim cmdCurrent as SqlCommand
Dim rdrCurrent as SqlDataReader

Conn = New SqlConnection(SqlConnectionString)
Conn.Open()

strSQL = SQLqueryString

cmdCurrent = new SqlCommand(strSQL, Conn)
rdrCurrent = cmdCurrent.ExecuteReader

While rdrCurrent.Read()
    'Do stuff
End While

If Not Conn is nothing then
    If Conn.State <> ConnectionState.Closed then
        Conn.Close()
    End If
End If
SqlConnectionString would equal something like "Provider=SQLExpress;User ID=User;Password=Password;Persist Security Info=True;Initial Catalog=DataInSQL;Data Source=RemoteLocation".

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Sorry, still didn't make myself clear; I'm OK with the actual SQL syntax and ADO connection strings. It's setting up a connection string to a web based server not a LAN one that I'm unclear about.

Brian
 
That's it exactly George - Many thanks guys

Brian
 
Have you considered XML Digital Signatures for your licensing model? Registering against a remote RDBMS is all very well, but what happens when the internet connection goes down, or if the user <shudder> doesn't have net access?

XML Digital Signatures give you a means for the user to submit information to you once (via an XML file), which you can then read (which modules he has for example) and then Mark the file in a manner that can only be done by you (encrypting a hash of the licensing details using your private key is a common means)... Your program can then decrypt using your public key, and then test the hash.

Just an idea...

Martin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top