943,722 Members | Top Members by Rank

Ad:
Apr 23rd, 2009
0

Database Connection Help

Expand Post »
I am trying to connect to a database but I have no clue how to do it or if it's even possible. The server address is: sql306.byethost5.com
How would I connect to this server if the username is usn and password is pwd?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
olabaz is offline Offline
2 posts
since Apr 2009
Apr 23rd, 2009
0

Re: Database Connection Help

Is it a MySQL database?
First you'd need to make sure your host allows connections from outside of their network (I mean this as in my friend's host SQL server only allows internal connections from his webspace or PHPMySQL Admin page - he can't use MySQL admin tools or anything on his PC)

You would need to check out http://www.connectionstrings.com when you know what SQL database system it is using (MSSQL, Oracle, MySQL etc)
Reputation Points: 13
Solved Threads: 17
Junior Poster
jonifen is offline Offline
152 posts
since Nov 2007
Apr 24th, 2009
0

Re: Database Connection Help

It's a MySQL database. I'm not sure I'm using the right code.

vb Syntax (Toggle Plain Text)
  1. Imports System.Data.SqlClient
  2.  
  3. Public Class Form1
  4.  
  5.  
  6.  
  7. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  8.  
  9. Dim sqlConn As New SqlConnection("server=serverAddress;uid=username;pwd=password;database=database;")
  10.  
  11. sqlConn.Open()
  12.  
  13. sqlConn.Close()
  14. End Sub
  15.  
  16. End Class
Last edited by olabaz; Apr 24th, 2009 at 5:07 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
olabaz is offline Offline
2 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: System stated overflow.
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Execute a file when a particular folder is opened.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC