Question Locked

Urgently required :vb6- sql 2005 connectivity.?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I m doing a project such that the database can be updated through vb6 screens....but i have no clue at all about how to connect to sql database.

1)please explain me what are the types of connection between the both(i m using vb6 enterprise edition and sql server 2005).

2)also give me info about all the software that need to be installed on my machine for the connection

3)give me step by step info about establishing the connection..right from which window to open,which object to insert etc.
.
please help me...i have to submit this project in 10 days.

2 replies

by bfilmfan

When you graduate school, do you plan to have everyone else do your work for you also?

1 and 2) You'd need an OBDC driver to connect to the SQL server.

3) Modify this code:

Private Sub Button1_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button1.Click

'Declare, instantiate, and open a connection

Dim cnn1 As SqlClient.SqlConnection = _

New SqlClient.SqlConnection("Data Source=CCS1;" & _

"Initial Catalog=HCVB;Integrated Security=SSPI")

Try

cnn1.Open()

MsgBox("Connection opened successfully.")

Catch ex1 As SqlClient.SqlException

MsgBox(ex1.Message)

Finally

cnn1.Close()

End Try

End Sub

Hey Instructor in India. BFilmFan gets an A.

This discussion is closed to new replies.