|
-
Feb 7th, 2007, 03:34 AM
#1
Thread Starter
New Member
Select
Hello
I have a form that loads user data from a table "A01_Archivio_DatiSoggetto"
There is a field "TipoPersona" and it can have 2 values "Persona Fisica, Persona Giuridica" I am trying to do a select to load only the "Peronsa Fisica" type users.
AdoDatiSoggetto is a Adoc with a Connection String "DSN=CIS"
I don't get a error but this code loads all the user with Persona Fisica and Persona Giuridica
Ehat should i do??
VB Code:
Private Sub cmdNext_Click()
Dim rs As Recordset
Dim NomeViaSearch As Integer
Set cn = New Connection
cn.Open "CIS"
Set rs = New Recordset
rs.Open "Select TipoPersona From [A01_Archivio_DatiSoggetto] Where TipoPersona = 'Persona Fisica'", cn, adOpenStatic, adLockOptimistic
Do Until rs.EOF
AdoDatiSoggetto.Recordset.MoveNext
If AdoDatiSoggetto.Recordset.EOF Then
AdoDatiSoggetto.Recordset.MovePrevious
End If
Loop
rs.Close
End Sub
Thanks
-
Feb 7th, 2007, 06:14 AM
#2
Re: Select
Try this.
VB Code:
Private Sub cmdNext_Click()
Dim rs As Recordset
Dim NomeViaSearch As Integer
Set cn = New Connection
cn.Open "CIS"
Set rs = New Recordset
rs.Open "Select TipoPersona From [A01_Archivio_DatiSoggetto] Where TipoPersona = 'Persona Fisica'", cn, adOpenStatic, adLockOptimistic
Do Until rs.EOF
AdoDatiSoggetto.Recordset.MoveFirst
If AdoDatiSoggetto.Recordset.EOF Then
AdoDatiSoggetto.Recordset.MovePrevious
End If
Loop
rs.Close
End Sub
-
Feb 7th, 2007, 06:40 AM
#3
Thread Starter
New Member
Re: Select
it doesn't do anything just shows me the first record all the time.
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
|