Connecting and manipulating remote database vb6 sql

Posted on 2007-09-29
Last Modified: 2013-12-25
Hello All

I am making a small game in vb6, now I want to have a highest score table included.  I want to have a database on my web space that holds the highest score table values.  I know the basics for entering and retrieving the values using sql.  

Basically what I need to know is how can I connect to the database on my web site and if so do I need to have any special features configured with my ISP who provide me with my web site space.

The code I use to alter and read from the database using sql is below

'Declaring your database
Public MyDatabase As ADODB.Connection

'Tables into your database
Public MyTable1 As ADODB.Recordset

Private Sub Form_Load()

'Set your variables to nothing (just for stability)
Set MyDatabase = Nothing
Set MyTable1 = Nothing

'Connecting to your DB
Set MyDatabase = New ADODB.Connection
Set MyTable1 = New ADODB.Recordset

'Here's where you're to set all your database options
ConnectionString = "Provider=SQLOLEDB.1" _
              & ";User ID=sa" _
              & ";Password=password" _
              & ";Initial Catalog=aTable" _
              & ";Data Source=mypc\SQLEXPRESS"

MyDatabase.Open ConnectionString
MyTable1.CursorLocation = adUseClient

'Insert into table
MyDatabase.Execute ("INSERT INTO Table_1 (name, address) VALUES ('new','value')")

'Delete from table, or to delete all use 'DELETE * FROM TableName'
MyDatabase.Execute ("DELETE  FROM Table_1 Where name='KJ'")
End Sub

I dont want to just show a web page with a list, I actually want to get the values from the aTable.mdf database held on my site and place them directly into my vb6 application.

I hope this makes sense


<password cleared by angelIII, zone advisor>
Question by:SirNick
    LVL 142

    Accepted Solution

    >I want to have a database on my web space
    reading .mdf as file, this means sql server. for this to work, you web hosting needs to have sql server installed and configured for your use. is that the case?
    if not, you cannot use ms sql server database to connect to.

    LVL 3

    Author Comment

    Thanks for your help...

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now