p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: ADODB Connection in VB SCRIPT (Help please)


Message #1 by PERRETTA Franco <Franco.PERRETTA@c...> on Wed, 6 Dec 2000 11:52:58 +0100
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_000_01C05F72.B2150ED0

Content-Type: text/plain;

	charset="iso-8859-1"



 <<ASP Connection.txt>> 



             Franco

___________________________________

                     Perretta Franco

                           Council of Europe

           Department of Information Technology

                      Information Access Unit

                     67075 Strasbourg Cedex

tel: +33 (0)3 88 41 22 18  fax: +33 (0)3 88 41 27 39

          mailto:franco.perretta@c...





------_=_NextPart_000_01C05F72.B2150ED0

Content-Type: text/plain;

	name="ASP Connection.txt"

Content-Transfer-Encoding: quoted-printable

Content-Disposition: attachment;

	filename="ASP Connection.txt"





Dear,

  I=92m developing in ASP with Visual Studio, and for help information 

I=92m reading

your book: =93PROFESSIONAL Active Server Page  3.0=94, but I can not 

find the fallowing solution:



When I make connection I use this syntax:



--------------------------------------------------------------------

<%

Set OBJdbConn =3D Server.CreateObject("ADODB.Connection")

OBJdbConn.Open "Provider=3DMSDASQL;DRIVER=3DSQL 

Server;SERVER=3Dacdc;DATABASE=3Ddct_manage;UID=3Ddct_manage;PWD=3D0b7k23

"



    'Create and Open Recordset Object

Set Rs =3D Server.CreateObject("ADODB.Recordset")

Rs.ActiveConnection =3D OBJdbConn

Rs.CursorType =3D adOpenKeyset

Rs.LockType =3D adLockOptimistic '25

Rs.Source =3D "Ta_GAL_Implique"

Rs.Open





      Rs.AddNew

      Rs("CodeGal") =3D Request.Form("CodeGal")

	  Rs("PaysGAL") =3D Request.Form("PaysGAL")

	  Rs("NumOrdre") =3D "Yes"

	  Rs("N_Group_X_Poj") =3D "Yes"

	  Rs("CodProj") =3D "Yes"

	  Rs("Pays") =3D "Yes"

	  Rs("Coordinat") =3D "Yes"

	  Rs("IntitulGal") =3D "Yes"

	  Rs.Update



 %>

--------------------------------------------------------------------



Now I need to use the same situation in VB SCRIPT, but does not work.

Do you have some suggestions how I can I use the same connection in VB 

SCRIPT?

The connection in VB SCRIPT is different than in ASP code (<%  %>) ?



------------------------------------------------------------------------

---

<SCRIPT LANGUAGE=3D"VBScript">



Set OBJdbConn =3D Server.CreateObject("ADODB.Connection")

OBJdbConn.Open "Provider=3DMSDASQL;DRIVER=3DSQL 

Server;SERVER=3Dacdc;DATABASE=3Ddct_manage;UID=3Ddct_manage;PWD=3D0b7k23

"



    ''''Create and Open Recordset Object

Set Rs =3D Server.CreateObject("ADODB.Recordset")

Rs.ActiveConnection =3D OBJdbConn

Rs.CursorType =3D adOpenKeyset

Rs.LockType =3D adLockOptimistic '25

Rs.Source =3D "Ta_GAL_Implique"

Rs.Open



      Rs.AddNew

      Rs("CodeGal") =3D Request.Form("CodeGal")

	  Rs("PaysGAL") =3D Request.Form("PaysGAL")

	  Rs("NumOrdre") =3D "Yes"

	  Rs("N_Group_X_Poj") =3D "Yes"

	  Rs("CodProj") =3D "Yes"

	  Rs("Pays") =3D "Yes"

	  Rs("Coordinat") =3D "Yes"

	  Rs("IntitulGal") =3D "Yes"

	  Rs.Update



</SCRIPT>

------------------------------------------------------------------------

----------

Thank you very much for your attention.





------_=_NextPart_000_01C05F72.B2150ED0--


  Return to Index