Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old June 17th, 2003, 11:56 AM
raviram80 raviram80 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 58 raviram80 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 sec
Reputation Power: 6
VBScript Code

Hii Theree

I have been trying for so long but this simple code does not seems to work. I would really be grateful if you can plss help me out with this code.The button in the code is not working. It does not get activated on clicking and there isno error message that that I am getting. I am at my wit's end.plss help me.

<html>

<head> </head>

<body>

<form method="POST" action="--WEBBOT-SELF--">


<input type="button" value="load data" OnClick="loaData();">


</form>


<script language="VBScript">


sub loadData()

dim conn
dim rs
dim qry

msgbox "hi"

Set conn = CreateObject("ADODB.Connection")
conn.CursorLocation = 3
Set rs = CreateObject("ADODB.Recordset")

conn.Open "TestDB"

': Queries
qry = "Select * from q4

rs.Open qry, conn, adOpenStatic

if not rs.eof then
rs.movelast
total = rs.recordcount
rs.movefirst
msgbox total & " records from Queries were loaded",,""
end if

conn.close
set rs = nothing
set conn = nothing

end sub

</script>

</body>

</html>

Thanks so much

Ravi

Reply With Quote
  #2  
Old June 17th, 2003, 12:09 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,827 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 22 h 57 m 29 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Your mixing different technologies here.
A simple VBScript example:
Code:
<html>
<script language="VBScript">
	sub loadData_onClick
		msgbox "Hi"
	end sub
</script>
<body>
<form method="POST" action="--WEBBOT-SELF--">
<input type="button" name="loadData" value="load data">
</form>
</body>
</html> 

Notice that the button name is set to "loadData" and the sub in the script section is called "loadData_onClick"

The first section is the name, the second is the event. This sub will be executed on the click of the button.

Reply With Quote
  #3  
Old June 18th, 2003, 02:13 PM
Coax Coax is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: South Africa
Posts: 3 Coax User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to Coax
Unhappy VBScript Code

I have noticed that you have not confined your coding to the standards as suggested in any programming manual when it comes to coding.

The first problem you have is the key to why you can't debug your entire code set, first off your button should not contain any sub-routine that is terminated by the ";" token.

Wrong:
<input type="button" value="load data" OnClick="loaData();">

Correnct:
<input type="button" value="load data" OnClick="loaData()" language="VBS">

Note: Try and declare your subroutines this way, emphasis on indentation and where the rroutine is defined.

Public Sub LoadData()
....
....
End Sub

Fixing this will then allow you to get a plethora of Logical Errors and Syntax Error. These will then lead you ro what you are trying to get done.

The second major problem you have shown is that you have not learnt how to properly manipulate database using VBScript. This topic is very wide, but I suggest you get with URL and get yourslef their latest VBScript Reference. This will guide you to how to solve your problem.

I hope you have learnt a thing or two about VBScript, the most obvious is that it SUCKS!!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > VBScript Code


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway