Re: Thanks - Part One - Re: Executing SP in VB6

From: "Iain" <iain(at)mst(dot)co(dot)jp>
To: "Sandro Yaqub Yusuf" <sandro(at)proservvi(dot)com(dot)br>, <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Thanks - Part One - Re: Executing SP in VB6
Date: 2004-10-06 10:42:49
Message-ID: 000b01c4ab91$3c6d4c20$7201a8c0@mst1x5r347kymb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi Sandro

are you saying that rsTB(0) = "(1,Sandro,123,"Sandro Yaqub Yusuf")"?

That would be interesting, but not very useful.

Does rsTB(1) fail as an invalid column?

Does rsTB.Fields("user").value work? (It should return "Sandro" according
to your data).

Regards
Iain

----- Original Message -----
From: "Sandro Yaqub Yusuf" <sandro(at)proservvi(dot)com(dot)br>
To: <pgsql-odbc(at)postgresql(dot)org>
Sent: Tuesday, October 05, 2004 11:35 PM
Subject: Thanks - Part One - Re: [ODBC] Executing SP in VB6

> Hello my dears friends,
>
> Thanks for yours colaborations.
>
> It´s here the part of solution about my problem with colaboration of
> everbody that help me (Philippe Lang, Iain, Andrew Ayers, Rick Sivernell,
> Corey W. Gibbs):
>
> ---------------------------------------------------------------------------------------------------------------------------------------
>
> POSTGRESQL:
>
> CREATE OR REPLACE FUNCTION sp_user_search(varchar)
> RETURNS SETOF user AS
> ' select * from user where user = $1'
> LANGUAGE 'sql' VOLATILE;
>
> ---------------------------------------------------------------------------------------------------------------------------------------
>
> VISUAL BASIC 6 with ADO 2.8 without STORED PROCEDURE:
>
> Dim adoBD As ADODB.Connection
> Dim rsTB As New ADODB.Recordset
>
> Set adoBD = New ADODB.Connection
>
> adoBD.ConnectionString =
> "driver=PostgreSQL};server=localhost;database=SICCEV;port=5432;uid=ryan;pwd=displace;"
> adoBD.Open
>
> Set rsTB = adoBD.Execute("select * from user where user = 'Sandro';")
>
> Do While Not rsTB.EOF
> MsgBox rsTB!Usuario
>
> rsTB.MoveNext
> Loop
>
> rsTB.Close
> adoBD.Close
>
> RESULT OF EXECUTION: Sandro Yaqub Yusuf
>
> ---------------------------------------------------------------------------------------------------------------------------------------
>
> VISUAL BASIC 6 with ADO 2.8 with STORED PROCEDURE:
>
> Dim adoBD As ADODB.Connection
> Dim rsTB As New ADODB.Recordset
>
> Set adoBD = New ADODB.Connection
>
> adoBD.ConnectionString =
> "driver=PostgreSQL};server=localhost;database=SICCEV;port=5432;uid=ryan;pwd=displace;"
> adoBD.Open
>
> Set rsTB = adoBD.Execute("select sp_user_search('Sandro');")
>
> Do While Not rsTB.EOF
> MsgBox rsTB(0)
>
> rsTB.MoveNext
> Loop
>
> rsTB.Close
> adoBD.Close
>
> RESULT OF EXECUTION: (1,Sandro,123,"Sandro Yaqub Yusuf")
>
> ---------------------------------------------------------------------------------------------------------------------------------------
>
> The question is how I do for to isolate the columns when come
> (1,Sandro,123,"Sandro Yaqub Yusuf"). I would like to get only the column
> FULLNAME using the STORED PROCEDURE. Have I do a function in VB for to
> isolate the RESULTS of STORED PROCEDURES in POSTGRESQL ?
>
> Thanks more one times...
>
> Sandroyy
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Dave Page 2004-10-06 12:04:59 Re: Still can't find ODBC driver in Data Source Administrator
Previous Message Dave Page 2004-10-06 07:26:02 Re: Still can't find ODBC driver in Data Source Administrator