pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgre and Visual Basic
7+ messages / 5 participants
[nested] [flat]

* Postgre and Visual Basic
@ 2006-03-07 14:47 dodol garut <jangkaru80@yahoo.com>
  2006-03-07 15:02 ` Re: Postgre and Visual Basic Adnan DURSUN <a_dursun@hotmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: dodol garut @ 2006-03-07 14:47 UTC (permalink / raw)
  To: pgsql-odbc

i need a sample of Visual Basic Project with PostgreSQL, anyone can help me?
  Trim's
   
  ERIS RISO
  Indonesia

Send instant messages to your online friends http://uk.messenger.yahoo.com 

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgre and Visual Basic
  2006-03-07 14:47 Postgre and Visual Basic dodol garut <jangkaru80@yahoo.com>
@ 2006-03-07 15:02 ` Adnan DURSUN <a_dursun@hotmail.com>
  2006-03-07 18:22   ` Re: Postgre and Visual Basic Adnan DURSUN <a_dursun@hotmail.com>
  2006-03-08 08:11   ` Re: [Polesoft Antispam]Re: Postgre and Visual Basic Christian Paul B. Cosinas <cpc@cybees.com>
  0 siblings, 2 replies; 7+ messages in thread

From: Adnan DURSUN @ 2006-03-07 15:02 UTC (permalink / raw)
  To: dodol garut <jangkaru80@yahoo.com>; pgsql-odbc


  ----- Original Message ----- 
  From: dodol garut 
  To: pgsql-odbc@postgresql.org 
  Sent: Tuesday, March 07, 2006 4:47 PM
  Subject: [ODBC] Postgre and Visual Basic


  >i need a sample of Visual Basic Project with PostgreSQL, anyone can help me?
  >Trim's

    What do you need ?

  Adnan DURSUN
  ASRIN Bilisim Ltd.
  TURKEY

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgre and Visual Basic
  2006-03-07 14:47 Postgre and Visual Basic dodol garut <jangkaru80@yahoo.com>
  2006-03-07 15:02 ` Re: Postgre and Visual Basic Adnan DURSUN <a_dursun@hotmail.com>
@ 2006-03-07 18:22   ` Adnan DURSUN <a_dursun@hotmail.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Adnan DURSUN @ 2006-03-07 18:22 UTC (permalink / raw)
  To: dodol garut <jangkaru80@yahoo.com>; pgsql-odbc


  ----- Original Message ----- 
    From: dodol garut 
    To: pgsql-odbc@postgresql.org 
    Sent: Tuesday, March 07, 2006 4:47 PM
    Subject: [ODBC] Postgre and Visual Basic


    >i need a sample of Visual Basic Project with PostgreSQL, anyone can help me?
    >Trim's

     This Sample function make a connection to database :
    -------------------------------------------------------------------------------------

    Public Function SystemLogon() As String
        Dim MyConn As New ADODB.Connection, myDSN As String, Rs As Object
        On Error GoTo Hata
        MyConn.Open "Provider=MSDASQL.1;Password=" & ConnSifre & ";Persist Security Info=True;UID=" & ConnUser & ";Data Source=" & ConnDataSource & ";DATABASE=" & ConnDataBase & ";SERVER=" & ConnServer & ""
        Set SetMyConn = MyConn
        SystemLogon = ""

        Exit Function
    Hata:
        SystemLogon = MyConn.Errors(0).Description
    End Function

    This Sample function executes a string (update,insert,delete) and returns number of effected rows :
    ------------------------------------------------------------------------------------

    Public Function ExecuteSQL(pSQLStr As String) As Long
        Dim AffectedRecords As Long
        MyCurConn.Execute pSQLStr, AffectedRecords, adCmdText
        ExecuteSQL = AffectedRecords
    End Function

    This Sample function executes a string (select) and returns a ADODB.recordset :
    -----------------------------------------------------------------------------------------------------------------------

    Public Function ExecuteSQLReturnRowSet(pSQLStr As String) As ADODB.Recordset
        Dim MyRs As ADODB.Recordset
        Set MyRs = New ADODB.Recordset
        MyRs.CursorLocation = adUseClient
        MyRs.Open pSQLStr, MyCurConn, adOpenStatic, adLockReadOnly
        Set ExecuteSQLReturnRowSet = MyRs
        Set MyRs = Nothing
    End Function
    I hope above samples helps to you...

    Adnan DURSUN
    ASRIN Bilisim Ltd.
    TURKEY

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [Polesoft Antispam]Re: Postgre and Visual Basic
  2006-03-07 14:47 Postgre and Visual Basic dodol garut <jangkaru80@yahoo.com>
  2006-03-07 15:02 ` Re: Postgre and Visual Basic Adnan DURSUN <a_dursun@hotmail.com>
@ 2006-03-08 08:11   ` Christian Paul B. Cosinas <cpc@cybees.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Christian Paul B. Cosinas @ 2006-03-08 08:11 UTC (permalink / raw)
  To: 'Adnan DURSUN' <a_dursun@hotmail.com>; 'dodol garut' <jangkaru80@yahoo.com>; pgsql-odbc

Just use ODBC Connection to interface Visual Basic and PostgreSQL

 

  _____  

From: pgsql-odbc-owner@postgresql.org
[mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Adnan DURSUN
Sent: Tuesday, March 07, 2006 7:03 AM
To: dodol garut; pgsql-odbc@postgresql.org
Subject: [Polesoft Antispam]Re: [ODBC] Postgre and Visual Basic

 

 

----- Original Message ----- 

From: dodol garut <mailto:jangkaru80@yahoo.com>  

To: pgsql-odbc@postgresql.org 

Sent: Tuesday, March 07, 2006 4:47 PM

Subject: [ODBC] Postgre and Visual Basic

 

>i need a sample of Visual Basic Project with PostgreSQL, anyone can help
me?

>Trim's

 

  What do you need ?

 

Adnan DURSUN
ASRIN Bilişim Ltd.

TURKEY



I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgre and Visual Basic
@ 2006-03-07 15:02 Tim Clarke <Tim.Clarke@manifest.co.uk>
  0 siblings, 0 replies; 7+ messages in thread

From: Tim Clarke @ 2006-03-07 15:02 UTC (permalink / raw)
  To: pgsql-odbc

Are you having trouble connecting from VB? I have declared and ODBC DSN
"pgresearch" via ADO and used that:



  Dim gcnResearch As ADODB.Connection
  Dim rsUId As ADODB.Recordset

' open the database
  Set gcnResearch = New ADODB.Connection
  With gcnResearch
    .ConnectionString = "dsn=pgresearch"
    .Properties("User ID") = txtUsername
    .Properties("Password") = txtPassword
    .Open
  End With



Tim Clarke

-----Original Message-----
From: pgsql-odbc-owner@postgresql.org
[mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of dodol garut
Sent: 07 March 2006 14:48
To: pgsql-odbc@postgresql.org
Subject: [ODBC] Postgre and Visual Basic


i need a sample of Visual Basic Project with PostgreSQL, anyone can help
me?
Trim's

ERIS RISO
Indonesia
Send instant messages to your online friends
http://uk.messenger.yahoo.com 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgre and Visual Basic
@ 2006-03-07 15:46 Tim Clarke <Tim.Clarke@manifest.co.uk>
  2006-03-07 16:25 ` Re: Postgre and Visual Basic Campbell, Greg <greg.campbell@us.michelin.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Tim Clarke @ 2006-03-07 15:46 UTC (permalink / raw)
  To: pgsql-odbc

To debug this sort of issue, take VB out of the picture: once it has
processed the line creating StrSql2 for you, run the SQL directly in
Postgres via some other method (we use pgAdmin) and make sure that code
is OK. Then you'll know whether this is a VB or a Postgres issue.

Tim Clarke

-----Original Message-----
From: dodol garut [mailto:jangkaru80@yahoo.com] 
Sent: 07 March 2006 15:24
To: Tim Clarke
Subject: Re: [ODBC] Postgre and Visual Basic


When I insert a reccord from my form in VB, there was an error message
"no columns defined in rowset"

and here is my query to insert that reccord:
dim StrSql2 as string
StrSql2 = "insert into produk(kodeproduk,namaproduk,hargasatuan)
values('" & text1.Text & "','" & Text2.Text & "'," & Text3.Text & ");"

project.dbScholl.Execute StrSql2 , , adCmdText

thanx before...



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgre and Visual Basic
  2006-03-07 15:46 Re: Postgre and Visual Basic Tim Clarke <Tim.Clarke@manifest.co.uk>
@ 2006-03-07 16:25 ` Campbell, Greg <greg.campbell@us.michelin.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Campbell, Greg @ 2006-03-07 16:25 UTC (permalink / raw)
  To: pgsql-odbc

 > project.dbScholl.Execute StrSql2 , , adCmdText
First, test the SQL statement in something like the SQL window of pgAdmin.


Then
Is dbScholl a database object (like DAO) or an ADODB.Connection object?
You should understand the difference and select one.

Presuming that you really want ADO,
Are you using liked tables? ..
If so then use something like
    CurrentProject.Connection.Execute StrSql2
If not linked tables then use something like
   Dim cnn as new ADODB.Connection
   cnn.Open "DSN=my_dbs_dsn_name" 'or a full PostgreSQL connection string to save a trip to the registry
   cnn.Execute StrSql2




Tim Clarke wrote:
> To debug this sort of issue, take VB out of the picture: once it has
> processed the line creating StrSql2 for you, run the SQL directly in
> Postgres via some other method (we use pgAdmin) and make sure that code
> is OK. Then you'll know whether this is a VB or a Postgres issue.
> 
> Tim Clarke
> 
> -----Original Message-----
> From: dodol garut [mailto:jangkaru80@yahoo.com] 
> Sent: 07 March 2006 15:24
> To: Tim Clarke
> Subject: Re: [ODBC] Postgre and Visual Basic
> 
> 
> When I insert a reccord from my form in VB, there was an error message
> "no columns defined in rowset"
> 
> and here is my query to insert that reccord:
> dim StrSql2 as string
> StrSql2 = "insert into produk(kodeproduk,namaproduk,hargasatuan)
> values('" & text1.Text & "','" & Text2.Text & "'," & Text3.Text & ");"
> 
> project.dbScholl.Execute StrSql2 , , adCmdText
> 
> thanx before...
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly

Attachments:

greg.campbell.vcf (text/x-vcard, 239B) download begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America - US5 Lexington;ENG-ASE email;internet:greg.campbell@us.michelin.com title:ASE Systems Engineer tel;work:803-951-5561/x75561 x-mozilla-html:FALSE version:2.1 end:vcard
^ permalink raw reply [nested|flat] 7+ messages in thread


end of thread, other threads:[~2006-03-08 08:11 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-07 14:47 Postgre and Visual Basic dodol garut <jangkaru80@yahoo.com>
2006-03-07 15:02 ` Adnan DURSUN <a_dursun@hotmail.com>
2006-03-07 18:22   ` Adnan DURSUN <a_dursun@hotmail.com>
2006-03-08 08:11   ` Christian Paul B. Cosinas <cpc@cybees.com>
2006-03-07 15:02 Re: Postgre and Visual Basic Tim Clarke <Tim.Clarke@manifest.co.uk>
2006-03-07 15:46 Re: Postgre and Visual Basic Tim Clarke <Tim.Clarke@manifest.co.uk>
2006-03-07 16:25 ` Campbell, Greg <greg.campbell@us.michelin.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox