|
 |
asp_ado_rds thread: How to connect ADODB in VB SCRIPT?
Message #1 by "Franco" <francO.perretta@c...> on Wed, 6 Dec 2000 11:25:03 -0000
|
|
Dear,
I?m developing in ASP with Visual Studio, and for help information I?m
reading
your book: ?PROFESSIONAL Active Server Page 3.0?, but I can not find the
fallowing solution:
When I make connection I use this syntax:
--------------------------------------------------------------------
<%
Set OBJdbConn = Server.CreateObject("ADODB.Connection")
OBJdbConn.Open "Provider=MSDASQL;DRIVER=SQL
Server;SERVER=acdc;DATABASE=dct_manage;UID=dct_manage;PWD=0b7k23"
'Create and Open Recordset Object
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.ActiveConnection = OBJdbConn
Rs.CursorType = adOpenKeyset
Rs.LockType = adLockOptimistic '25
Rs.Source = "Ta_GAL_Implique"
Rs.Open
Rs.AddNew
Rs("CodeGal") = Request.Form("CodeGal")
Rs("PaysGAL") = Request.Form("PaysGAL")
Rs("NumOrdre") = "Yes"
Rs("N_Group_X_Poj") = "Yes"
Rs("CodProj") = "Yes"
Rs("Pays") = "Yes"
Rs("Coordinat") = "Yes"
Rs("IntitulGal") = "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="VBScript">
Set OBJdbConn = Server.CreateObject("ADODB.Connection")
OBJdbConn.Open "Provider=MSDASQL;DRIVER=SQL
Server;SERVER=acdc;DATABASE=dct_manage;UID=dct_manage;PWD=0b7k23"
''''Create and Open Recordset Object
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.ActiveConnection = OBJdbConn
Rs.CursorType = adOpenKeyset
Rs.LockType = adLockOptimistic '25
Rs.Source = "Ta_GAL_Implique"
Rs.Open
Rs.AddNew
Rs("CodeGal") = Request.Form("CodeGal")
Rs("PaysGAL") = Request.Form("PaysGAL")
Rs("NumOrdre") = "Yes"
Rs("N_Group_X_Poj") = "Yes"
Rs("CodProj") = "Yes"
Rs("Pays") = "Yes"
Rs("Coordinat") = "Yes"
Rs("IntitulGal") = "Yes"
Rs.Update
</SCRIPT>
----------------------------------------------------------------------------------
Thank you very much for your attention.
Message #2 by "Tom Molskow" <tmolskow@h...> on Wed, 06 Dec 2000 08:46:38 -0500
|
|
What kind of error message are you getting? Do you have the MDAC 2.5 or
greater installed to your development client and server? What are you
referencing in the project? What tool are you using for development?
>From: "Franco" <francO.perretta@c...>
>Reply-To: "ASP_ADO_RDS" <asp_ado_rds@p...>
>To: "ASP_ADO_RDS" <asp_ado_rds@p...>
>Subject: [asp_ado_rds] How to connect ADODB in VB SCRIPT?
>Date: Wed, 6 Dec 2000 11:25:03 -0000
>
>Dear,
> I?m developing in ASP with Visual Studio, and for help information I?m
>reading
>your book: ?PROFESSIONAL Active Server Page 3.0?, but I can not find the
>fallowing solution:
>
>When I make connection I use this syntax:
>
>--------------------------------------------------------------------
><%
>Set OBJdbConn = Server.CreateObject("ADODB.Connection")
>OBJdbConn.Open "Provider=MSDASQL;DRIVER=SQL
>Server;SERVER=acdc;DATABASE=dct_manage;UID=dct_manage;PWD=0b7k23"
>
> 'Create and Open Recordset Object
>Set Rs = Server.CreateObject("ADODB.Recordset")
>Rs.ActiveConnection = OBJdbConn
>Rs.CursorType = adOpenKeyset
>Rs.LockType = adLockOptimistic '25
>Rs.Source = "Ta_GAL_Implique"
>Rs.Open
>
>
> Rs.AddNew
> Rs("CodeGal") = Request.Form("CodeGal")
> Rs("PaysGAL") = Request.Form("PaysGAL")
> Rs("NumOrdre") = "Yes"
> Rs("N_Group_X_Poj") = "Yes"
> Rs("CodProj") = "Yes"
> Rs("Pays") = "Yes"
> Rs("Coordinat") = "Yes"
> Rs("IntitulGal") = "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="VBScript">
>
>Set OBJdbConn = Server.CreateObject("ADODB.Connection")
>OBJdbConn.Open "Provider=MSDASQL;DRIVER=SQL
>Server;SERVER=acdc;DATABASE=dct_manage;UID=dct_manage;PWD=0b7k23"
>
> ''''Create and Open Recordset Object
>Set Rs = Server.CreateObject("ADODB.Recordset")
>Rs.ActiveConnection = OBJdbConn
>Rs.CursorType = adOpenKeyset
>Rs.LockType = adLockOptimistic '25
>Rs.Source = "Ta_GAL_Implique"
>Rs.Open
>
> Rs.AddNew
> Rs("CodeGal") = Request.Form("CodeGal")
> Rs("PaysGAL") = Request.Form("PaysGAL")
> Rs("NumOrdre") = "Yes"
> Rs("N_Group_X_Poj") = "Yes"
> Rs("CodProj") = "Yes"
> Rs("Pays") = "Yes"
> Rs("Coordinat") = "Yes"
> Rs("IntitulGal") = "Yes"
> Rs.Update
>
></SCRIPT>
>----------------------------------------------------------------------------------
>
>Thank you very much for your attention.
>
>
>
Tom Molskow
Developer/Programmer
Microsoft Web Technologies
xxx-xxx-xxxx
Message #3 by "Julio César Rodríguez" <julio_cesar.rodriguez@s...> on Wed, 6 Dec 2000 14:30:55 -0000
|
|
Hi,
I'm totally agree with Tom, if you could answer those questions, may be we
can help you. I'd like to add something, the Request object is part of the
ASP object model only, you cant't use it in VB SCRIPT.
Regards.
Julio
|
|
 |