Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: SV: [asp_components] RE: web enabling VB application


Message #1 by info@s... on Thu, 15 Jun 2000 19:02:07 +0200
What´s wrong with this one?



<%	Set Connect = Server.CreateObject("ADODB.Connection")

	Connect.Open "DSN=sd-studios_db3;UID=;PWD="



	Set RecSet = Server.CreateObject("ADODB.Recordset")



   Visa = "SELECT Fraga FROM fraga"

   RecSet.Open Visa, Connect, adOpenStatic, adLockOptimistic %>



   <b><% =RecSet("Fraga") %></b><p>



<% RecSet.Close



	Set RecSet = Server.CreateObject("ADODB.Recordset")



   Visa = "SELECT Ja, Nej FROM svar"

   RecSet.Open Visa, Connect, adOpenStatic, adLockOptimistic



	If Request.Form("fraga") = "Ja" Then

	Ja = RecSet("Ja")

	RecSet("Ja") = Ja -- 1

	RecSet.Update



	ElseIf Request.Form("fraga") = "Nej" Then

	Nej = RecSet("Nej")

	RecSet("Nej") = Nej -- 1

	RecSet.Update

	End If



	Yes = RecSet("Ja")

	No = RecSet("Nej")

	Summa = Yes -- No %>



Ställningen just nu:<br>



<% YResultat = "0"

	NResultat = "0"



	If Yes => "1" Then

	YResultat = Round(Yes / Summa * 100)

	End If



	If No => "1" Then

	NResultat = Round(No / Summa * 100)

	End If %>



Ja: <b><% =YResultat %>%</b><br>

Nej: <b><% =NResultat %>%</b><p>



Antal svar hittills: <b><% =Summa %></b>



<%	RecSet.Close

	Connect.Close %>



Please help!

--

Martin Johansson

VD, Sola Data HB

http://www.sd-gaming.com

http://www.sd-studios.com



Message #2 by "Ken Schaefer" <ken.s@a...> on Fri, 16 Jun 2000 19:14:40 +1000
How about you tell us what's wrong? (or do we have to guess...)



Cheers

Ken



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

From: "Sola Data HB" 

To: "ASP Databases" <asp_databases@p...>

Sent: Saturday, June 17, 2000 3:04 AM

Subject: [asp_databases] SV: [asp_components] RE: web enabling VB

application





> What=B4s wrong with this one?

>

> <% Set Connect =3D Server.CreateObject("ADODB.Connection")

> Connect.Open "DSN=3Dsd-studios_db3;UID=3D;PWD=3D"



<snipped for your viewing comfort>




  Return to Index