Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export proble need help.

Status
Not open for further replies.

BEJW

Programmer
Mar 25, 2003
13
US
Hello,

The following are my codes, but doesn't work.
Many thanks,
JW

***************************

<HTML>
<HEAD><% @LANGUAGE = VBScript %>
Response.ContentType = &quot;application/vnd.ms-excel&quot;

<TITLE>Post</TITLE>
</HEAD>
<BODY>

<%


dim whichAction

If Request.ServerVariables(&quot;QUERY_STRING&quot;) <> &quot;&quot; Then
whichAction = Request.QueryString(&quot;action&quot;)
else
whichAction = Request.Form(&quot;Action&quot;)
End if
response.write(whichAction)

If (whichaction = &quot;Add New&quot;) Then
%>
<form method=&quot;POST&quot; name=&quot;Add&quot; action=&quot;post.asp&quot;>
<p>
First Name <input type=&quot;text&quot; name=&quot;FirstName&quot; size=&quot;20&quot; tabindex=&quot;1&quot;><br>
Last Name <input type=&quot;text&quot; name=&quot;LastName&quot; size=&quot;20&quot; tabindex=&quot;2&quot;><br>
Date of Birth <input type=&quot;text&quot; name=&quot;DOB&quot; size=&quot;13&quot; value=&quot;MM/DD/YYYY&quot; tabindex=&quot;3&quot;><br>
Education <input type=&quot;text&quot; name=&quot;Education&quot; size=&quot;2&quot; tabindex=&quot;4&quot;><br>
Diagnosis <select size=&quot;1&quot; name=&quot;Diagnosis&quot;>
<option>Age-Associated Memory Impairment</option>
<option>Age-Related Cognitive Decline</option>
<option>Alcohol Abuse/Dependence</option>
<option>Alcohol Dementia</option>
<option>Alzheimer's Disease</option>
<option>Alzheimer's Disease (Early Onset)</option>
<option>Alzheimer's Disease (Early Onset) w/bd</option>
<option>Alzheimer's Disease w/beh dist.</option>
<option>Alzheimer's Disease w/SH</option>
<option>Alzheimer's Disease w/Stroke</option>
<option>Alzheimer's Disease w/WM disease</option>
<option>Amnestic Disorder NOS</option>
<option>Amyloid Angiopathy</option>
<option>Anoxia/Hypoxia</option>
<option>Apathy</option>
<option>Aphasia</option>
<option>Ataxia</option>
<option>Attention Deficit Disorder</option>
<option>Autism</option>
<option>AVM/Aneurysm</option>
<option>Basal Ganglia Calcifications</option>
<option>Behavioral Disturbance</option>
<option>Bipolar Disorder</option>
<option>CADASIL</option>
<option>Cerebellar Disorder</option>
<option>Cognitive Disorder NOS</option>
<option>Corticobasal Degeneration</option>
<option>Creutzfeld-Jacob Disease</option>
<option>Cysticercosis</option>
<option>Cysts</option>
<option>DBS Depression</option>
<option>DBS OCD</option>
<option>Delirium</option>
<option>Dementia NOS</option>
<option>Dementia with Lewy Bodies</option>
<option>Depression</option>
<option>Depression-Vascular</option>
<option>Developmental Disorders</option>
<option>Down's Syndrome</option>
<option>Dystonia</option>
<option>Encephalitis</option>
<option>Epilepsy</option>
<option>Familial Alzheimer's Disease</option>
<option>Forced Normalization</option>
<option>Frontal Lesion</option>
<option>Frontal-Temporal Dementia</option>
<option>Guillain-Barre Syndrome</option>
<option>Hemiparesis</option>
<option>Hemiplegia</option>
<option>Herniation</option>
<option>HIV</option>
<option>Huntington's Disease</option>
<option>Hydrocephalus</option>
<option>Infectious Diseases</option>
<option>Lobotomy</option>
<option>Lupus</option>
<option>Lyme Disease</option>
<option>Medication</option>
<option>Meningioma</option>
<option>Mesial Temporal Sclerosis</option>
<option>Metabolic Disorder</option>
<option>Migraine</option>
<option>Mild Cognitive Impairment-Amnestic</option>
<option>Mild Cognitive Impairment-Other</option>
<option>Mild Cognitive Impairment-Vascular</option>
<option>Mixed Dementia</option>
<option>Movement Disorders (non-PD)</option>
<option>MS/Demyelination</option>
<option>Multiple System Atrophy</option>
<option>Narcolepsy</option>
<option>Neuropathy</option>
<option>Neurosurgical (non-lobotomy)</option>
<option>No Cognitive Impairment</option>
<option>Normal Pressure Hydrocephalus</option>
<option>Obesity</option>
<option>OCD Deep Brain Stimulation</option>
<option>OCD/Gamma Knife</option>
<option>Parkinson's Disease</option>
<option>Parkinson's Disease-Vascular</option>
<option>Parkinson's Plus Syndrome</option>
<option>Personality Disorder</option>
<option>Pituitary Disorder</option>
<option>Pregnancy</option>
<option>Primary Progressive Aphasia</option>
<option>Progressive Supranuclear Palsy</option>
<option>Psychiatric Disorders</option>
<option>Psychogenic</option>
<option>Radiation Necrosis</option>
<option>REM Sleep Behavior Disorder</option>
<option>Sarcoidosis</option>
<option>Schizophrenia</option>
<option>Spinal Cord Disorder</option>
<option>Stroke: Hemorrhagic</option>
<option>Stroke: Large Vessel</option>
<option>Stroke: Posterior Circulation</option>
<option>Stroke: Small Vessel Subcortical</option>
<option>Subcortical Vascular Disease</option>
<option>Subdural Hematoma</option>
<option>Substance Abuse</option>
<option>Tardrive Dyskinesia</option>
<option>Tourette's Syndrome</option>
<option>Toxin</option>
<option>Transient Ischemic Attack</option>
<option>Traumatic Brain Injury</option>
<option>Trigeminal Neuralgia</option>
<option>Tumors</option>
<option>Tumors vs. Stroke</option>
<option>Vascular Dementia: Large Vessel</option>
<option>Vascular Dementia: Small Vessel</option>
<option>Vasculitis</option>
<option>Wernick-Korsakoff Syndrome</option>
</select><br>
Diagnostic Code <input type=&quot;text&quot; name=&quot;DiagnosticCode&quot; size=&quot;6&quot; tabindex=&quot;5&quot;><br>
Subcortical Hyperintenisites (SH) <select size=&quot;1&quot; name=&quot;SH&quot;>
<option>Mild</option>
<option>Moderate</option>
<option>Severe</option>
</select></p>
<p><input type=&quot;submit&quot; name=&quot;Action&quot; value=&quot;Add&quot; tabindex=&quot;7&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot;></p>
</form>
<%

ElseIf (whichaction = &quot;Add&quot;) Then

dim myconnection, connectString, strQuery, objRS
dim strFirstName, strLastName, strDOB, strEducation, strDiagnosis, strDiagnosticCode, strSH

connectString = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & &quot;DBQ=&quot; & Server.MapPath(&quot;C:\Inetpub\ & &quot;;&quot;
set myConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
myConnection.Open connectString

objRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)

strFirstName = request.form(&quot;FirstName&quot;)
strLastName = request.form(&quot;LastName&quot;)
strDOB = Request.form(&quot;DOB&quot;)
strEducation = Request.form(&quot;Education&quot;)
strDiagnosis = Request.form(&quot;Diagnosis&quot;)
strDiagnosticCode = Request.form(&quot;DiagnosticCode&quot;)
strSH = Request.form(&quot;SH&quot;)

strQuery = &quot;INSERT INTO Patients(FirstName, LastName, DOB, Education, Diagnosis, DiagnosticCode, SH) VALUES &quot;
strQuery = strQuery & &quot;('&quot; & strFirstName & &quot;','&quot; & strLastName & &quot;','&quot; & strDOB & &quot;','&quot; & strEducation & &quot;','&quot;
strQuery = strQuery & strDiagnosis & &quot;','&quot; & strDiagnosticCode & &quot;','&quot; & strSH & &quot;')&quot;
myConnection.Execute strQuery

Set myConnection = Nothing
Set objRS = Nothing


ElseIf (whichaction = &quot;Edit&quot;) Then

dim Connection, cString, sQuery, oRS

cString = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & &quot;DBQ=&quot; & Server.MapPath(&quot;C:\Inetpub\ & &quot;;&quot;
set Connection = Server.CreateObject(&quot;ADODB.Connection&quot;)
Connection.Open cString

Set oRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)

PatID = Request.QueryString(&quot;ID&quot;)

sQuery = &quot;select * from Patients where PatientID = &quot; & PatID
Set oRS = Connection.Execute(sQuery)
%>

<form method=&quot;POST&quot; name=&quot;Add&quot; action=&quot;post.asp&quot;>
<p>
First Name <input type=&quot;text&quot; name=&quot;FirstName&quot; size=&quot;20&quot; tabindex=&quot;1&quot; value=&quot;<%=oRS(&quot;FirstName&quot;)%>&quot;><br>
Last Name <input type=&quot;text&quot; name=&quot;LastName&quot; size=&quot;20&quot; tabindex=&quot;2&quot; value=&quot;<%=oRS(&quot;LastName&quot;)%>&quot;><br>
Date of Birth <input type=&quot;text&quot; name=&quot;DOB&quot; size=&quot;13&quot; tabindex=&quot;3&quot; value=&quot;<%=oRS(&quot;DOB&quot;)%>&quot;><br>
Education <input type=&quot;text&quot; name=&quot;Education&quot; size=&quot;2&quot; tabindex=&quot;4&quot; value=&quot;<%=oRS(&quot;Education&quot;)%>&quot;><br>
Diagnosis <select size=&quot;1&quot; name=&quot;Diagnosis&quot; selected=&quot;<%=oRS(&quot;Diagnosis&quot;)%>&quot;>
<option>Age-Associated Memory Impairment</option>
<option>Age-Related Cognitive Decline</option>
<option>Alcohol Abuse/Dependence</option>
<option>Alcohol Dementia</option>
<option>Alzheimer's Disease</option>
<option>Alzheimer's Disease (Early Onset)</option>
<option>Alzheimer's Disease (Early Onset) w/bd</option>
<option>Alzheimer's Disease w/beh dist.</option>
<option>Alzheimer's Disease w/SH</option>
<option>Alzheimer's Disease w/Stroke</option>
<option>Alzheimer's Disease w/WM disease</option>
<option>Amnestic Disorder NOS</option>
<option>Amyloid Angiopathy</option>
<option>Anoxia/Hypoxia</option>
<option>Apathy</option>
<option>Aphasia</option>
<option>Ataxia</option>
<option>Attention Deficit Disorder</option>
<option>Autism</option>
<option>AVM/Aneurysm</option>
<option>Basal Ganglia Calcifications</option>
<option>Behavioral Disturbance</option>
<option>Bipolar Disorder</option>
<option>CADASIL</option>
<option>Cerebellar Disorder</option>
<option>Cognitive Disorder NOS</option>
<option>Corticobasal Degeneration</option>
<option>Creutzfeld-Jacob Disease</option>
<option>Cysticercosis</option>
<option>Cysts</option>
<option>DBS Depression</option>
<option>DBS OCD</option>
<option>Delirium</option>
<option>Dementia NOS</option>
<option>Dementia with Lewy Bodies</option>
<option>Depression</option>
<option>Depression-Vascular</option>
<option>Developmental Disorders</option>
<option>Down's Syndrome</option>
<option>Dystonia</option>
<option>Encephalitis</option>
<option>Epilepsy</option>
<option>Familial Alzheimer's Disease</option>
<option>Forced Normalization</option>
<option>Frontal Lesion</option>
<option>Frontal-Temporal Dementia</option>
<option>Guillain-Barre Syndrome</option>
<option>Hemiparesis</option>
<option>Hemiplegia</option>
<option>Herniation</option>
<option>HIV</option>
<option>Huntington's Disease</option>
<option>Hydrocephalus</option>
<option>Infectious Diseases</option>
<option>Lobotomy</option>
<option>Lupus</option>
<option>Lyme Disease</option>
<option>Medication</option>
<option>Meningioma</option>
<option>Mesial Temporal Sclerosis</option>
<option>Metabolic Disorder</option>
<option>Migraine</option>
<option>Mild Cognitive Impairment-Amnestic</option>
<option>Mild Cognitive Impairment-Other</option>
<option>Mild Cognitive Impairment-Vascular</option>
<option>Mixed Dementia</option>
<option>Movement Disorders (non-PD)</option>
<option>MS/Demyelination</option>
<option>Multiple System Atrophy</option>
<option>Narcolepsy</option>
<option>Neuropathy</option>
<option>Neurosurgical (non-lobotomy)</option>
<option>No Cognitive Impairment</option>
<option>Normal Pressure Hydrocephalus</option>
<option>Obesity</option>
<option>OCD Deep Brain Stimulation</option>
<option>OCD/Gamma Knife</option>
<option>Parkinson's Disease</option>
<option>Parkinson's Disease-Vascular</option>
<option>Parkinson's Plus Syndrome</option>
<option>Personality Disorder</option>
<option>Pituitary Disorder</option>
<option>Pregnancy</option>
<option>Primary Progressive Aphasia</option>
<option>Progressive Supranuclear Palsy</option>
<option>Psychiatric Disorders</option>
<option>Psychogenic</option>
<option>Radiation Necrosis</option>
<option>REM Sleep Behavior Disorder</option>
<option>Sarcoidosis</option>
<option>Schizophrenia</option>
<option>Spinal Cord Disorder</option>
<option>Stroke: Hemorrhagic</option>
<option>Stroke: Large Vessel</option>
<option>Stroke: Posterior Circulation</option>
<option>Stroke: Small Vessel Subcortical</option>
<option>Subcortical Vascular Disease</option>
<option>Subdural Hematoma</option>
<option>Substance Abuse</option>
<option>Tardrive Dyskinesia</option>
<option>Tourette's Syndrome</option>
<option>Toxin</option>
<option>Transient Ischemic Attack</option>
<option>Traumatic Brain Injury</option>
<option>Trigeminal Neuralgia</option>
<option>Tumors</option>
<option>Tumors vs. Stroke</option>
<option>Vascular Dementia: Large Vessel</option>
<option>Vascular Dementia: Small Vessel</option>
<option>Vasculitis</option>
<option>Wernick-Korsakoff Syndrome</option>
</select><br>
Diagnostic Code <input type=&quot;text&quot; name=&quot;DiagnosticCode&quot; size=&quot;6&quot; tabindex=&quot;5&quot; value=&quot;<%=oRS(&quot;DiagnosticCode&quot;)%>&quot;><br>
Subcortical Hyperintenisites (SH) <select size=&quot;1&quot; name=&quot;SH&quot;>
<option>Mild</option>
<option>Moderate</option>
<option>Severe</option>
</select></p>
<input type=&quot;Hidden&quot; name=&quot;PatientID&quot; value=&quot;<%=oRS(&quot;PatientID&quot;)%>&quot;>

<p><input type=&quot;submit&quot; name=&quot;Action&quot; value=&quot;Update&quot; tabindex=&quot;7&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot;></p>
</form>
<%
ElseIf (whichaction = &quot;Update&quot;) Then

connectString = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & &quot;DBQ=&quot; & Server.MapPath(&quot;C:\Inetpub\ & &quot;;&quot;
set myConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
myConnection.Open connectString

objRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)

strFirstName = request.form(&quot;FirstName&quot;)
strLastName = request.form(&quot;LastName&quot;)
strDOB = Request.form(&quot;DOB&quot;)
strEducation = Request.form(&quot;Education&quot;)
strDiagnosis = Request.form(&quot;Diagnosis&quot;)
strDiagnosticCode = Request.form(&quot;DiagnosticCode&quot;)
strSH = Request.form(&quot;SH&quot;)
PatID = Request.Form(&quot;PatientID&quot;)

strQuery = &quot;INSERT INTO Patients(FirstName, LastName, DOB, Education, Diagnosis, DiagnosticCode, SH) VALUES &quot;
strQuery = strQuery & &quot;('&quot; & strFirstName & &quot;','&quot; & strLastName & &quot;','&quot; & strDOB & &quot;','&quot; & strEducation & &quot;','&quot;
strQuery = strQuery & strDiagnosis & &quot;','&quot; & strDiagnosticCode & &quot;','&quot; & strSH & &quot;') WHERE PatientID = &quot; & PatID & &quot;;&quot;
Response.write(strQuery)
myConnection.Execute strQuery

'objRS(&quot;FirstName&quot;) = strFirstName
'objRS(&quot;LastName&quot;) = strLastName
'objRS(&quot;DOB&quot;) = strDOB
'objRS(&quot;Education&quot;) = strEducation
'objRS(&quot;Diagnosis&quot;) = strDiagnosis
'objRS(&quot;DiagnosticCode&quot;) = strDiagnosticCode
'objRS(&quot;SH&quot;) = strSH
'objRS.Update

End If
%>
</BODY>
</HTML>
 
Define doesn't work...?

Does it give you an error or just not display anything, or grind forveer wand then timeout...

If it displays an error, what is the error and section of code the error occurs in?

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Do you know how hot your computer is running at home? I do
 
this will not work
Server.MapPath(&quot;C:\Inetpub\

____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811

onpnt2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top