Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VBScript Question
Message
De
02/06/1999 14:07:56
Raymond Humphrys
Michigan Department of Community Health
Bath, Michigan, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00225044
Message ID:
00225512
Vues:
11
How would you handle Hospital where hospital may be something like Oakland Osteopathic Hospital. You can;t use a prime.


>I sent you an internet email. The UT didn't like the script I had in my message body. Let me know if you don't receive it.
>
>
>>Using SQL 6.5 and developing an ADO recordset on the Server Side and passing it through IIS this is the server side script that populates an array "LocalArray".
>>This array does not seem to accessible on the client side VBScript. How do we make this array accessible from client-side vbscript procedures such as Combo1_OnChange().
>>
>>My problem is i need to populate a combo box based upon a users selection from a different combo box. The values for the second combo box must come from an ado recordset. I thought the way to do this is to create an array on the client side that can be used from a vbscript procedure. My code for creating the array is below.
>>
>><%
>>rsHosp.MoveFirst
>>Dim LocalArray(2, 14)
>>For i = 0 to 14
>> LocalArray(0, i) = rsHosp.fields("occco")
>> LocalArray(1, i) = rsHosp.fields("hosp")
>> LocalArray(2, i) = rsHosp.fields("HospitalName")
>> rsHosp.MoveNext
>>Next
>>'Response.Write LocalArray(2, 5)
>>'Session("ServerArray") = LocalArray
>>%>
>>
>>Then, my code for the combo1_OnChange() event is:
>>
>>sub Combo1_OnChange()
>>dim tmp, hos
>> for i = 0 to 15
>> set oOption = document.createElement("OPTION")
>> tmp = LocalArray(1, i)
>> hos = LocalArray(2, i)
>> oOption.text = hos
>> oOption.value = tmp
>> form.Combo2.add(oOption)
>> next
>>end sub
>>
>>
>>
>>>Why not just use the ADO Recordset to populate the client side combo box?
>>>
>>>>I did not want to take advantage of anyone's largesse by posting a question only tangentially related to VFP. However, if you insist. I need to know how to build a client side array from a SQL server recordset using VBScript. Example, on SQL Server I have a table with 3 columns, a, b, and C. I want to use ADO to build a recordset and pass these data down to a client side array to populate a drop-down combo box. I can hard code the values of a, b, and c into the VBScript, but the rows in the Server side table will constantly change so that is not a good idea.
>>>>
>>>>If this too far afield for this forum just nuke it ...
>>>>
>>>>thanks
>>>>>Why don't you post your VBScript question??? You will probably get your question answered.....correctly..< bg >
>>>>>
>>>>>
>>>>>>Does anyone know of a good VBScript forum like the UT and VFP. I've got a VBScript question.
>>>>>>
>>>>>>thanks
Some days it's not worth chewing through the leather straps ...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform