Hello experts,
O.k I give up on this. I have an LDAP query from asp working
correctly. It is returning data fine. Now I need to know how to take
this data and then submitt it into the database. Can this be done in
one page and is there any other way to do this without putting a submit
button on a page. Almost like a file that I can pass to the user and
he can click it to insert into a database. My way of do it is to
simply to put a submit button on the page and when the user hits submit
the values selected will go to the database. However the only thing on
this page is a submit(kinda useless).
This is part of my code - <form name="form1" method="post" action="ldap_second.asp">
-
-
<TABLE BORDER = 2>
-
<TR><TD>Name</TD>
-
<TD>Mail</TD>
-
<TD>GivenName</TD>
-
<TD>Address</TD>
-
</TR>
-
-
<%
-
Do Until objRecordSet.EOF%>
-
<%
-
Dim N
-
Dim M
-
Dim GN
-
N = objRecordset("Name")
-
M = objRecordset("Mail")
-
GN = objRecordset("GivenName")
-
SA = objRecordset("StreetAddress")
-
-
response.write "<TR>"
-
response.write "<TD>" & N & "</TD>"
-
response.write "<TD>" & M & "</TD>"
-
response.write "<TD>" & GN & "</TD>"
-
response.write "<TD>" & SA & "</TD>"
-
response.write "</TR>"
-
%>
-
<% objRecordSet.MoveNext
-
Loop
-
%>
-
</TABLE>
-
<p><input type="submit" value="Submit" name="B1</p>
-
Now on my ldap_second how to I take the values and submit them to a
database. Your help is appreciated. 6 1845
"MrHelpMe" <cl********@hotmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Hello experts,
O.k I give up on this. I have an LDAP query from asp working
correctly. It is returning data fine. Now I need to know how to take
this data and then submitt it into the database. Can this be done in
one page and is there any other way to do this without putting a submit
button on a page. Almost like a file that I can pass to the user and
he can click it to insert into a database. My way of do it is to
simply to put a submit button on the page and when the user hits submit
the values selected will go to the database. However the only thing on
this page is a submit(kinda useless).
This is part of my code - <form name="form1" method="post" action="ldap_second.asp">
-
<TABLE BORDER = 2>
-
<TR><TD>Name</TD>
-
<TD>Mail</TD>
-
<TD>GivenName</TD>
-
<TD>Address</TD>
-
</TR>
-
<%
-
Do Until objRecordSet.EOF%>
-
<%
-
Dim N
-
Dim M
-
Dim GN
-
N = objRecordset("Name")
-
M = objRecordset("Mail")
-
GN = objRecordset("GivenName")
-
SA = objRecordset("StreetAddress")
-
response.write "<TR>"
-
response.write "<TD>" & N & "</TD>"
-
response.write "<TD>" & M & "</TD>"
-
response.write "<TD>" & GN & "</TD>"
-
response.write "<TD>" & SA & "</TD>"
-
response.write "</TR>"
-
%>
-
<% objRecordSet.MoveNext
-
Loop
-
%>
-
</TABLE>
-
<p><input type="submit" value="Submit" name="B1</p>
-
Now on my ldap_second how to I take the values and submit them to a
database. Your help is appreciated.
Well, given that a form requires fields to be of any use (as you alluded to)
why not simply response.write the values into hidden form fields?
--
Mike Brind
Mike thanks for the reply. Anyway you could show me how to do that
with some sample code? Sorry still learning everything:)
Mike Brind wrote:
"MrHelpMe" <cl********@hotmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Hello experts,
O.k I give up on this. I have an LDAP query from asp working
correctly. It is returning data fine. Now I need to know how to take
this data and then submitt it into the database. Can this be done in
one page and is there any other way to do this without putting a submit
button on a page. Almost like a file that I can pass to the user and
he can click it to insert into a database. My way of do it is to
simply to put a submit button on the page and when the user hits submit
the values selected will go to the database. However the only thing on
this page is a submit(kinda useless).
This is part of my code - <form name="form1" method="post" action="ldap_second.asp">
-
-
<TABLE BORDER = 2>
-
<TR><TD>Name</TD>
-
<TD>Mail</TD>
-
<TD>GivenName</TD>
-
<TD>Address</TD>
-
</TR>
-
-
<%
-
Do Until objRecordSet.EOF%>
-
<%
-
Dim N
-
Dim M
-
Dim GN
-
N = objRecordset("Name")
-
M = objRecordset("Mail")
-
GN = objRecordset("GivenName")
-
SA = objRecordset("StreetAddress")
-
-
response.write "<TR>"
-
response.write "<TD>" & N & "</TD>"
-
response.write "<TD>" & M & "</TD>"
-
response.write "<TD>" & GN & "</TD>"
-
response.write "<TD>" & SA & "</TD>"
-
response.write "</TR>"
-
%>
-
<% objRecordSet.MoveNext
-
Loop
-
%>
-
</TABLE>
-
<p><input type="submit" value="Submit" name="B1</p>
-
Now on my ldap_second how to I take the values and submit them to a
database. Your help is appreciated.
Well, given that a form requires fields to be of any use (as you alluded to)
why not simply response.write the values into hidden form fields?
--
Mike Brind
Do it in the same way as you've written the table out using response.write.
Response.Write "<input type=""hidden""... etc
--
Mike Brind
"MrHelpMe" <cl********@hotmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Mike thanks for the reply. Anyway you could show me how to do that
with some sample code? Sorry still learning everything:)
Mike Brind wrote:
>"MrHelpMe" <cl********@hotmail.comwrote in message news:11*********************@i3g2000cwc.googlegro ups.com...
Hello experts,
O.k I give up on this. I have an LDAP query from asp working
correctly. It is returning data fine. Now I need to know how to take
this data and then submitt it into the database. Can this be done in
one page and is there any other way to do this without putting a submit
button on a page. Almost like a file that I can pass to the user and
he can click it to insert into a database. My way of do it is to
simply to put a submit button on the page and when the user hits submit
the values selected will go to the database. However the only thing on
this page is a submit(kinda useless).
This is part of my code - <form name="form1" method="post" action="ldap_second.asp">
-
<TABLE BORDER = 2>
-
<TR><TD>Name</TD>
-
<TD>Mail</TD>
-
<TD>GivenName</TD>
-
<TD>Address</TD>
-
</TR>
-
<%
-
Do Until objRecordSet.EOF%>
-
<%
-
Dim N
-
Dim M
-
Dim GN
-
N = objRecordset("Name")
-
M = objRecordset("Mail")
-
GN = objRecordset("GivenName")
-
SA = objRecordset("StreetAddress")
-
response.write "<TR>"
-
response.write "<TD>" & N & "</TD>"
-
response.write "<TD>" & M & "</TD>"
-
response.write "<TD>" & GN & "</TD>"
-
response.write "<TD>" & SA & "</TD>"
-
response.write "</TR>"
-
%>
-
<% objRecordSet.MoveNext
-
Loop
-
%>
-
</TABLE>
-
<p><input type="submit" value="Submit" name="B1</p>
-
Now on my ldap_second how to I take the values and submit them to a
database. Your help is appreciated. Well, given that a form requires fields to be of any use (as you alluded to) why not simply response.write the values into hidden form fields?
-- Mike Brind
Thanks again Mike,
So now I got it working and the hidden variables are being passed over.
The code is as follows: -
Dim oConn
-
Dim sSQL
-
Dim N
-
Dim M
-
Dim GN
-
Dim SA
-
Dim objRS
-
-
N=Request.Form("Name")
-
M=Request.Form("Email")
-
GN=Request.Form("GivenName")
-
SA=Request.Form("StreetAddress")
-
-
-
Set oConn = Server.CreateObject("ADODB.Connection")
-
oConn.Open ("connection")
-
'set ObjRS = server.CreateObject ("ADODB.Recordset")
-
-
If Request.Form("SubmitButton") = "Submit" Then
-
-
Do While Not ObjRS.EOF
-
-
sSQL = "INSERT into Tablex (Name, Mail, GName,PostalCode)"
-
sSQL = sSQL & "VALUES ('" & N&"', '"& M&"', '" & GN&"', '" &
-
SA&"')"
-
oConn.Execute ssql
-
-
ObjRS.MoveNext
-
Loop
-
ObjRS.close
-
set ObjRS = nothing
-
oConn.close
-
set oConn = nothing
-
End If
-
%>
-
However, now I am receiving error: -
-
Error Type:
-
ADODB.Recordset (0x800A0E78)
-
Operation is not allowed when the object is closed.
-
/activedirectory/ldap_second.asp, line 22
-
Any ideas? Thanks.
Mike Brind wrote:
Do it in the same way as you've written the table out using response.write.
Response.Write "<input type=""hidden""... etc
--
Mike Brind
"MrHelpMe" <cl********@hotmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Mike thanks for the reply. Anyway you could show me how to do that
with some sample code? Sorry still learning everything:)
Mike Brind wrote:
"MrHelpMe" <cl********@hotmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Hello experts,
O.k I give up on this. I have an LDAP query from asp working
correctly. It is returning data fine. Now I need to know how to take
this data and then submitt it into the database. Can this be done in
one page and is there any other way to do this without putting a submit
button on a page. Almost like a file that I can pass to the user and
he can click it to insert into a database. My way of do it is to
simply to put a submit button on the page and when the user hits submit
the values selected will go to the database. However the only thing on
this page is a submit(kinda useless).
This is part of my code - <form name="form1" method="post" action="ldap_second.asp">
-
-
<TABLE BORDER = 2>
-
<TR><TD>Name</TD>
-
<TD>Mail</TD>
-
<TD>GivenName</TD>
-
<TD>Address</TD>
-
</TR>
-
-
<%
-
Do Until objRecordSet.EOF%>
-
<%
-
Dim N
-
Dim M
-
Dim GN
-
N = objRecordset("Name")
-
M = objRecordset("Mail")
-
GN = objRecordset("GivenName")
-
SA = objRecordset("StreetAddress")
-
-
response.write "<TR>"
-
response.write "<TD>" & N & "</TD>"
-
response.write "<TD>" & M & "</TD>"
-
response.write "<TD>" & GN & "</TD>"
-
response.write "<TD>" & SA & "</TD>"
-
response.write "</TR>"
-
%>
-
<% objRecordSet.MoveNext
-
Loop
-
%>
-
</TABLE>
-
<p><input type="submit" value="Submit" name="B1</p>
-
Now on my ldap_second how to I take the values and submit them to a
database. Your help is appreciated.
Well, given that a form requires fields to be of any use (as you alluded
to)
why not simply response.write the values into hidden form fields?
--
Mike Brind
MrHelpMe wrote:
Thanks again Mike,
So now I got it working and the hidden variables are being passed over.
The code is as follows: -
Dim oConn
-
Dim sSQL
-
Dim N
-
Dim M
-
Dim GN
-
Dim SA
-
Dim objRS
-
N=Request.Form("Name")
-
M=Request.Form("Email")
-
GN=Request.Form("GivenName")
-
SA=Request.Form("StreetAddress")
-
Set oConn = Server.CreateObject("ADODB.Connection")
-
oConn.Open ("connection")
-
'set ObjRS = server.CreateObject ("ADODB.Recordset")
-
If Request.Form("SubmitButton") = "Submit" Then
-
Do While Not ObjRS.EOF
-
sSQL = "INSERT into Tablex (Name, Mail, GName,PostalCode)"
-
sSQL = sSQL & "VALUES ('" & N&"', '"& M&"', '" & GN&"', '" &
-
SA&"')"
-
oConn.Execute ssql
-
ObjRS.MoveNext
-
Loop
-
ObjRS.close
-
set ObjRS = nothing
-
oConn.close
-
set oConn = nothing
-
End If
-
%>
-
However, now I am receiving error: -
Error Type:
-
ADODB.Recordset (0x800A0E78)
-
Operation is not allowed when the object is closed.
-
/activedirectory/ldap_second.asp, line 22
-
Any ideas? Thanks.
The insert is a one time deal. There's no reason to be looping through
it, as there's nothing to loop through (it's an INSERT, not a select).
The error is from "Do While Not ObjRS.EOF" because ObjRS has not been
opened.
I see. Thanks Larry for the response.
Larry Bud wrote:
MrHelpMe wrote:
Thanks again Mike,
So now I got it working and the hidden variables are being passed over.
The code is as follows: -
Dim oConn
-
Dim sSQL
-
Dim N
-
Dim M
-
Dim GN
-
Dim SA
-
Dim objRS
-
-
N=Request.Form("Name")
-
M=Request.Form("Email")
-
GN=Request.Form("GivenName")
-
SA=Request.Form("StreetAddress")
-
-
-
Set oConn = Server.CreateObject("ADODB.Connection")
-
oConn.Open ("connection")
-
'set ObjRS = server.CreateObject ("ADODB.Recordset")
-
-
If Request.Form("SubmitButton") = "Submit" Then
-
-
Do While Not ObjRS.EOF
-
-
sSQL = "INSERT into Tablex (Name, Mail, GName,PostalCode)"
-
sSQL = sSQL & "VALUES ('" & N&"', '"& M&"', '" & GN&"', '" &
-
SA&"')"
-
oConn.Execute ssql
-
-
ObjRS.MoveNext
-
Loop
-
ObjRS.close
-
set ObjRS = nothing
-
oConn.close
-
set oConn = nothing
-
End If
-
%>
-
However, now I am receiving error: -
-
Error Type:
-
ADODB.Recordset (0x800A0E78)
-
Operation is not allowed when the object is closed.
-
/activedirectory/ldap_second.asp, line 22
-
Any ideas? Thanks.
The insert is a one time deal. There's no reason to be looping through
it, as there's nothing to loop through (it's an INSERT, not a select).
The error is from "Do While Not ObjRS.EOF" because ObjRS has not been
opened.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike R |
last post by:
Hi,
I cant figure out how to do this....
for example:
Select name from mytab order by col1
could return
Mike
|
by: Tcs |
last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't
loaded it yet. I'm still using MS Access. And no, I don't believe this is an
Access question. (But who knows? I...
|
by: Brian |
last post by:
Hello all -
I am trying to Insert a new record to an Access 2002 database.
Following the insert, I need to obtain the primary key of the inserted
row (person_ID) which is an Autonumber field. I...
|
by: Grant McLean |
last post by:
Hi
First a simple question ...
I have a table "access_log" that has foreign keys "app_id" and
"app_user_id" that reference the "application_type" and "app_user"
tables. When I insert into...
|
by: suslikovich |
last post by:
Hi all,
I am getting this error when insert values from one table to another in
the first table the values are varchar (10). In the second they are
datetime. The format of the data is mm/dd/yyyy...
|
by: satish |
last post by:
Values of two columns in two different tables--presentation using
select
Hi Everyone,
i have two tables in the database . One is called address table
and one is adressPhone Table. Below...
|
by: Andrew S |
last post by:
Hello Mr. Expert:
- I have 3 tables in mysql in MyISAM table format, I am using mysql4.0
on freebsd5.3
- producttbl, productdetailentbl, pricetblN
- they all have "productid" as the Primary KEY....
|
by: PinkBishop |
last post by:
I am using VS 2005 with a formview control trying to insert a record
to my access db. The data is submitted to the main table no problem,
but I need to carry the catID to the bridge table...
|
by: rshivaraman |
last post by:
CREATE TABLE RS_A(ColA char(1), ColB varchar(10))
INSERT INTO RS_A
VALUES ('S', 'shakespeare')
INSERT INTO RS_A
VALUES ('B', 'shakespeare')
INSERT INTO RS_A
VALUES ('P', 'shakespeare')
...
|
by: paulmitchell507 |
last post by:
I think I am attempting a simple procedure but I just can't figure out
the correct syntax. My asp (classic) page runs a SELECT query to
obtain dates and ID's from 2 tables
uSQL = "SELECT...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |