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:
Learn four approaches for automating Excel logic, along with advantages and disadvantages of each. Read all about it in the free whitepaper: “Tapping into Excel Logic from Java: Four Server-Based AlternativesDownload Now!
  #1  
Old June 23rd, 2003, 01:12 PM
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
problem in a code:plss help

hii guys

I have a code below in combination of php and vbscript...the problem is in the vbscript portion... the sub routine "downloadData_onclick()" , in that the first query is getting executed but 'qry2' is not getting executed. can anyone tell me why i have been stuck on this...or if i can place the qry2 somewhere else in the code plss tell me where i can put that

<html>

<body>


<?php


$db1 = mysql_connect('localhost', 'mysql', '');

mysql_select_db("nihserver",$db1);

$result = mysql_query("SELECT * FROM nihserver.queries2 where saveFlag = 1",$db1);

$data = ( bool )false;


while ( $res = mysql_fetch_row($result) )
{
$row_data = implode( '|', $res );
$data .= $row_data . '*' . "\n";
}

mysql_close($db1);

$result4= mysql_query("update nihserver.queries2 SET saveFlag = 2 where saveFlag = 1");
?>

<form method="POST" action="--WEBBOT-SELF--">
<button name="downloadData">Transfer data</button>
</form>


<script language="VBScript">

sub downloadData_onclick()
s = txtQueryData.value

': Queries

dim conn
dim rs
dim connStr
dim qry
dim qry2
Set conn = createObject("ADODB.Connection")
conn.CursorLocation = 3
set rs = createObject("adodb.recordset")
conn.Open "TestDB"

msgbox "hi"

arr = split(s,"*")

qryDataCnt = ubound(arr)

msgbox qryDataCnt

for i = lbound(arr) to ubound(arr)
queryArr = split(arr(i),"|")
queryID = queryArr(0)
formName = queryArr(1)
'day = queryArr(2)
eleName = queryArr(3)
MRN=queryArr(4)
queryType = queryArr(5)
queryTitle = queryArr(6)
query = queryArr(7)

queryDate1 = queryArr(8)
queryDate=cdate(queryDate1)
answer = queryArr(9)

answerDate1=queryArr(10)
answerDate = cdate(answerDate1)

site = queryArr(11)
userID = queryArr(12)
user = queryArr(13)
saveFlag = queryArr(14)
queryTime = queryArr(15)


qry = "Insert into
Queries2(queryID,formName,eleName,MRN,queryType,queryTitle,query,queryDate,answer,answerDate,site,us erID,user,saveFlag,queryT

ime) " & _
"values (" & queryID & ",'" & formName & "','" & eleName & "','" & MRN & "','" &

queryType & "','" & queryTitle & "','" & query & "','" & queryDate & "','" & answer & "','" & answerDate & "','" & site &

"','" & userID & "','" & user & "','" & saveFlag & "','" & queryTime & "') "

conn.execute qry
erase queryArr
next
'msgbox "QueryData successfully downloaded.",,""
txtQueryData.value = ""

qry2 = "Update Queries2 Set saveFlag = 2 Where ((saveFlag = 1))"
conn.Execute qry2

conn.close
set rs = nothing
set conn = nothing

erase arr
end sub

</script>

<br><input type="hidden" name="txtDBname2" size="20" value="NIH">
<br><input type="hidden" name="txtDBtable2" size="20" value="Observations">
<br><input type="hidden" name="txtWhichWay2" size="20">

<br>&nbsp;<input type="hidden" name="txtQueryData" size="20" value="<?=$data?>">

</body>
</html>

thanks so much

ravi

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > problem in a code:plss help


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