Re- conectar postgres con visual basic

From: <ing_enriquebarrios(at)argentina(dot)com>
To: lestatoscar(at)gmail(dot)com
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re- conectar postgres con visual basic
Date: 2006-10-17 11:40:43
Message-ID: 20061017114014.A8CB73B0176@ns-1.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

<html>
<PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>PostgreSQL ODBC <o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Dim cn as Variant<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Dim sql as String<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>Dim rs as Variant<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>set cn = CreateObject ("ADODB.Connection")<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.Open "dsn=PostgreSQL;uid=sak;pwd=sak"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.CursorLocation = 3<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>sql = "create table testm ("<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>sql = sql & "id[char(8),"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=ES-AR style="mso-bidi-font-family: 'Courier New'; mso-ansi-language: ES-AR"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>sql = sql & "nombre[char(20),"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN lang=ES-AR style="mso-bidi-font-family: 'Courier New'; mso-ansi-language: ES-AR"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>sql = sql & "apellido[char(20),"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>sql = sql & "asignatura[char(25)"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>sql = sql & ")"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.Execute sql<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.BeginTrans<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.Execute "insert into testm values ('val1','val2','val3','val4')"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.Execute "insert into testm values ('val1','val2','val3','val4')"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.Execute "insert into testm values ('val1','val2','val3','val4')"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.Execute "insert into testm values ('val1','val2','val3','val4')"<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.CommitTrans<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>set rs = cn.Execute("select * from testm")<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>do until rs.EOF<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>print rs.EOF<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>rs.MoveNext<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>loop<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>rs.Close<o:p></o:p></FONT></FONT></SPAN></PRE><PRE><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040>&nbsp;</FONT></FONT></SPAN><SPAN style="mso-bidi-font-family: 'Courier New'"><FONT size=2><FONT color=#404040><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>cn.Close<o:p></o:p></FONT></FONT></SPAN></PRE>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><FONT face="Times New Roman">&nbsp;<o:p></o:p></FONT></FONT></P>
</html><BR><br><addr>------------------------------------------------------------------------<br>
<b><a href=http://free.internet.argentina.com/>Conectate a Internet Gratis de Argentina.Com</a></b><br>
</addr>
<br>
<center>
<a href=http://srvads.argentina.com/bs/adclick.php?n=a84973ad target=_blank>
<img src=http://srvads.argentina.com/bs/adview.php?what=zone:8&n=a84973ad border=0 alt=""></a>
</center>

Attachment Content-Type Size
unknown_filename text/html 7.0 KB

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Pedro Mateo 2006-10-17 15:31:03 Re: una duda sobre funciones
Previous Message Gauto Miguel A. 2006-10-17 11:35:07 RE: error al crear FK