Postgre and Visual Basic

Postgre and Visual Basic

am 07.03.2006 15:47:46 von dodol garut

--0-914122044-1141742866=:76741
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

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

Send instant messages to your online friends http://uk.messenger.yahoo.co=
m=20
--0-914122044-1141742866=:76741
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

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 ht=
tp://uk.messenger.yahoo.com=20
--0-914122044-1141742866=:76741--

Re: Postgre and Visual Basic

am 07.03.2006 16:02:36 von Tim Clarke

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 =3D New ADODB.Connection
With gcnResearch
.ConnectionString =3D "dsn=3Dpgresearch"
.Properties("User ID") =3D txtUsername
.Properties("Password") =3D 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=20

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: Postgre and Visual Basic

am 07.03.2006 16:02:57 von Adnan DURSUN

This is a multi-part message in MIME format.

------=_NextPart_000_007A_01C64208.FB691FA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


----- Original Message -----=20
From: dodol garut=20
To: pgsql-odbc@postgresql.org=20
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
------=_NextPart_000_007A_01C64208.FB691FA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-1">




 

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
----- Original Message -----

style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black">From:=20
href=3D"mailto:jangkaru80@yahoo.com">dodol=20
garut

To: title=3Dpgsql-odbc@postgresql.org=20
=
href=3D"mailto:pgsql-odbc@postgresql.org">pgsql-odbc@postgre sql.org
=

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

Subject: [ODBC] Postgre and =
Visual=20
Basic



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

>Trim's

 

  What do you need ?

 

Adnan DURSUN
ASRIN Bilişim Ltd.

TURKEY


------=_NextPart_000_007A_01C64208.FB691FA0--

Re: Postgre and Visual Basic

am 07.03.2006 16:46:55 von Tim Clarke

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]=20
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 =3D "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

Re: Postgre and Visual Basic

am 07.03.2006 17:25:39 von Greg Campbell

This is a multi-part message in MIME format.
--------------050408070707060100080100
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

> 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

--------------050408070707060100080100
Content-Type: text/x-vcard; charset=utf-8;
name="greg.campbell.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="greg.campbell.vcf"

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


--------------050408070707060100080100
Content-Type: text/plain
Content-Disposition: inline
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

--------------050408070707060100080100--

Re: Postgre and Visual Basic

am 07.03.2006 19:22:09 von Adnan DURSUN

This is a multi-part message in MIME format.

------=_NextPart_000_00A1_01C64224.CF79A6F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


----- Original Message -----=20
From: dodol garut=20
To: pgsql-odbc@postgresql.org=20
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=3DMSDASQL.1;Password=3D" & ConnSifre & =
";Persist Security Info=3DTrue;UID=3D" & ConnUser & ";Data Source=3D" & =
ConnDataSource & ";DATABASE=3D" & ConnDataBase & ";SERVER=3D" & =
ConnServer & ""
Set SetMyConn =3D MyConn
SystemLogon =3D ""

Exit Function
Hata:
SystemLogon =3D 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 =3D 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 =3D New ADODB.Recordset
MyRs.CursorLocation =3D adUseClient
MyRs.Open pSQLStr, MyCurConn, adOpenStatic, adLockReadOnly
Set ExecuteSQLReturnRowSet =3D MyRs
Set MyRs =3D Nothing
End Function
I hope above samples helps to you...

Adnan DURSUN
ASRIN Bilisim Ltd.
TURKEY
------=_NextPart_000_00A1_01C64224.CF79A6F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-1">




 

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
----- Original Message -----

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black">From:=20
href=3D"mailto:jangkaru80@yahoo.com">dodol=20
garut


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

Subject: [ODBC] Postgre and =
Visual=20
Basic

size=3D2> face=3DArial size=3D2> size=3D2> size=3D2> face=3DArial=20
size=3D2>


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

>Trim's

 

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


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

 

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

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

 

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

 
face=3DArial=20
size=3D2>

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

=
size=3D2>--------------------------------------------------- -------------=
-------------------------------------------------------


Public Function=20
ExecuteSQLReturnRowSet(pSQLStr As String) As=20
ADODB.Recordset
    Dim MyRs As=20
ADODB.Recordset
    Set MyRs =3D New=20
ADODB.Recordset

    =
MyRs.CursorLocation =
adUseClient
    MyRs.Open pSQLStr, MyCurConn,=20
adOpenStatic, adLockReadOnly
    Set=20
ExecuteSQLReturnRowSet =3D MyRs
    Set MyRs =
Nothing
End Function
size=3D2>

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> face=3DArial size=3D2>
I hope above samples helps to you...

 

Adnan DURSUN
ASRIN Bilişim Ltd.

TURKEY


------=_NextPart_000_00A1_01C64224.CF79A6F0--

Re: [Polesoft Antispam]Re: Postgre and Visual Basic

am 08.03.2006 09:11:53 von cpc

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C64244.E895AB50
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

Just use ODBC Connection to interface Visual Basic and PostgreSQL

=20

_____ =20

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

=20

=20

----- Original Message -----=20

From: dodol garut =20

To: pgsql-odbc@postgresql.org=20

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

Subject: [ODBC] Postgre and Visual Basic

=20

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

>Trim's

=20

What do you need ?

=20

Adnan DURSUN
ASRIN Bili=BAim Ltd.

TURKEY



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

------=_NextPart_000_000A_01C64244.E895AB50
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable


xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">




namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"country-region"/>
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>









style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Just use ODBC Connection to =
interface
Visual Basic and PostgreSQL



style=3D'font-size:
10.0pt;font-family:Arial;color:navy'> 





size=3D3
face=3D"Times New Roman">






style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:
size=3D2
face=3DTahoma>
pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] =
style=3D'font-weight:bold'>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





style=3D'font-size:
12.0pt'> 





style=3D'font-size:
12.0pt'> 





1.5pt;padding:0pt 0pt 0pt 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-right:0pt;margin- bottom:5.0pt'=
>



style=3D'font-size:10.0pt;
font-family:Arial'>----- Original Message ----- =







face=3DArial> style=3D'font-size:10.0pt;font-family:Arial;font-weight:bold '>From: > size=3D2 face=3DArial> style=3D'font-size:10.0pt;font-family:Arial'> href=3D"mailto:jangkaru80@yahoo.com" =
title=3D"jangkaru80@yahoo.com">dodol garut







style=3D'font-size:10.0pt;
font-family:Arial;font-weight:bold'>To:
face=3DArial> href=3D"mailto:pgsql-odbc@postgresql.org" =
title=3D"pgsql-odbc@postgresql.org">pgsql-odbc@postgresql.or g







style=3D'font-size:10.0pt;
font-family:Arial;font-weight:bold'>Sent:
size=3D2
face=3DArial> =
Tuesday, March 07,
2006 4:47 PM







style=3D'font-size:10.0pt;
font-family:Arial;font-weight:bold'>Subject:
size=3D2
face=3DArial> [ODBC] =
Postgre and
Visual Basic







style=3D'font-size:
12.0pt'> 







style=3D'font-size:
12.0pt'>>i need a sample of Visual Basic Project with PostgreSQL, =
anyone can
help me?







style=3D'font-size:
12.0pt'>>Trim's







style=3D'font-size:
12.0pt'> 







style=3D'font-size:
12.0pt'>  What do you need ?







style=3D'font-size:
12.0pt'> 







style=3D'font-size:
12.0pt'>Adnan DURSUN

ASRIN Bili=BAim Ltd.







w:st=3D"on"> size=3D3 face=3D"Times New Roman"> style=3D'font-size:12.0pt'>TURKEY region>













I choose Polesoft Lockspam to fight spam, and you?

TARGET=3D"_blank">http://www.polesoft.com/refer.html



------=_NextPart_000_000A_01C64244.E895AB50--