Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Querys(Link access2000 to vb6)

Status
Not open for further replies.

Monzer

Programmer
May 24, 2002
26
CA
I linked access to vb, and every thing work good, but my problem is that in access i have querys for finding a customer either by phone# or last name or by contract#.
Would sommebody please tell me if i should use an SQLquery
in the data environment or simply use input boxs to find a customer and how!

Here is a sample of my vb code:

Option Explicit
'Dim en As rdoEnvironment
'Dim Cn As New rdoConnection
'Dim Rs As rdoResultset
'Dim Col As rdoColumn
'Dim Qy As rdoQuery
'Dim SQL As String
'Dim TimeExpected As Single
'Dim Ts As Single, Tn As Single
'Private Sub Command1_Click()
'Rs.Cancel
'Dim InString As String
'MaskEdBox1.inputLen = 0

'If MaskEdBox1.InBufferCount Then
' With Rs.Requery
' While .StillExecuting
' SpinGlobe
' DoEvents
'Wend
'End With
'InString = MaskEdBox1.Input
'ShowRS
'End If

'End Sub

'Sub ShowRS()
'With Rs
' frmCustomerServices.Cls
' For Each Col In .rdoColumns
' Print
'Next
'Print
'Do Until .EOF
' For Each Col In .rdoColumns
' Print Col,
'Next
'Print
'.MoveNext
' Loop
'End With
'End Sub

'Sub SpinGlobe()
' Animate a globe here to show query is in progress.
'Print ".";
'End Sub

'Private Sub Form_Load()
'Set en = rdoEngine.rdoDataEnvironments1
'With Cn
' .Connect = "UID=;PWD=;Database=Dadaco1;" _
' & "Server=sequel;Driver={SQL Server}" _
'& "DSN='Dadaco1';"
'.LoginTimeout = 5
'.EstablishConnection rdDriverNoPrompt, True
'Set Qy = .CreateQuery("Customer Phone #", _
'"{ call master..sp_FOB CS (?) }")
'Qy.RowsetSize = 1
'Set Rs = Qy.OpenResultSet(rdOpenForwardOnly, _
'rdConcurReadOnly, rdAsyncEnable)
'Show
'ShowRS
'End With
'End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top