|
-
Aug 13th, 2002, 10:08 PM
#1
Thread Starter
Lively Member
My coding doesn't seems to work??
Need some advice from all the vb gurus here...
Below are the coding
Option Explicit
Public siebeldb As ADODB.Connection
Public nicedb As ADODB.Connection
Public rs1 As ADODB.Recordset
Public rs2 As ADODB.Recordset
Dim sql_Siebel As String
Private Sub cmExit_Click()
End
End Sub
Private Sub Form_Load()
Dim intRecCount As Integer
Dim intCounter As Integer
Set siebeldb = New ADODB.Connection
Set nicedb = New ADODB.Connection
Set rs1 = New ADODB.Recordset
Set rs2 = New ADODB.Recordset
'siebeldb.open opens SQL Server Connection
siebeldb.Open "Provider=sqloledb;" & _
"Data Source=rightfax;" & _
"Initial Catalog=siebel_database;" & _
"User Id=sa;" & _
"Password="
sql_Siebel = "SELECT Call_Type FROM siebel_table"
rs1.Open sql_Siebel, siebeldb, 0, 1
'nicedb.open opens SQL Server Connection
nicedb.Open "Provider=sqloledb;" & _
"Data Source=IMD;" & _
"Initial Catalog=NICE;" & _
"User Id=sa;" & _
"Password="
Set rs1 = New ADODB.Recordset
rs1.CursorType = adOpenKeyset
rs1.LockType = adLockOptimistic
rs1.Open "siebel_table", siebeldb, , , adCmdTable
Set rs2 = New ADODB.Recordset
rs2.CursorType = adOpenKeyset
rs2.LockType = adLockOptimistic
rs2.Open "nice_table", nicedb, , , adCmdTable
'List out the call type column from siebel and nice database
'Note that using this method, every time the database moves to the next record it must make a check to see if it has reached the end of the file.
'This slows the looping down a great deal, but it works.
rs1.MoveFirst
Do While Not rs1.EOF
lsSiebel.AddItem rs1("Call_Type")
rs1.MoveNext
Loop
rs2.MoveFirst
Do While Not rs2.EOF
lsNice.AddItem rs2("Call_Type")
rs2.MoveNext
Loop
'Trying another method (see below), it suppose to list out the data faster but not sure why not working. There is no error but nothing list out at the lsSiebel list box
'rs1.MoveLast
'intRecCount = rs1.RecordCount
'rs1.MoveFirst
'For intCounter = 1 To intRecCount
'lsSiebel.AddItem rs1("Call_Type")
'rs1.MoveNext
'Next intCounter
End Sub
It doesn't seems to work...I am trying to list out the data using a for loop so that it can load the data out faster...please advice
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|