Hi,
Am new to VB. Can anyone tell me the code to import data from a DB table and display it in a farpoint spread control 3.0??? VB6.0 code is reqd., thanks in advance.

Recommended Answers

All 4 Replies

What is the database that you want to connect ?

How you connect to database ?

What is the database that you want to connect ?

How you connect to database ?

SQL server DB, and i connect to it using ADO
Here is the connection string :
con = "Provider = MSDASQL.1; Extended Properties= 'DSN=Sample; UID=servionuser ;PWD=servionT@123; APP=Visual Basic ;WSID=SGSLDTP0341; DATABASE=MediusDB'"

1. Connect to database.
2. Create Recordset.
3. Populate the grid using the recordset as the source.

use the properties and methods of the control to bind to the DB recordset.

Or you can use below method........

Dim con As New ADODB.Connection

Private Sub Command1_Click()
Dim rs As Recordset
con.ConnectionString = "Type Connection String"
con.Open
Set rs = con.Execute("select * from customers")

With rs
If Not rs.EOF And Not .BOF Then
Do While Not .EOF
spCustomer.Row = spCustomer.MaxRows
spCustomer.Col = 1
spCustomer.Text = .Fields("CustomerID")
spCustomer.Col = 2
spCustomer.Text = .Fields("CustomerName")

spCustomer.MaxRows = spCustomer.MaxRows + 1
.MoveNext
Loop
End If
End With
End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.