Google Groepen ondersteunt geen nieuwe Usenet-berichten of -abonnementen meer. Historische content blijft zichtbaar.

ASP,ACCESS SHOW TABLES COLUMN NAME

53 weergaven
Naar het eerste ongelezen bericht

m.nedim...@gmail.com

ongelezen,
31 aug 2015, 09:22:4331-08-2015
aan
I want to draw a line from the classic asp to access database information.
I mean the name field in a table you want to assign to variables.

Evertjan.

ongelezen,
31 aug 2015, 09:34:2731-08-2015
aan
m.nedim...@gmail.com wrote on 31 Aug 2015 in
microsoft.public.inetserver.asp.general:

> I want to draw a line from the classic asp to access database information.

Lines are not methods to access a database.

> I mean the name field in a table you want to assign to variables.

What is a "name field"?

=====================================

A *database* consists of *tables*, each consisting of *records*.

Each *record* in a given *table* has the same number of *fields*

Each given *field* is of certain *type*,
and if that type is *string* of a maximum *length*

Each *database*,
each *table*,
and each *column of fields*
has a name.

Please restate what you want within the above framework.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

mehmet nedim akgül

ongelezen,
31 aug 2015, 10:16:1831-08-2015
aan
I want to get their names on the line

The image links available
http://i.hizliresim.com/aDgEd5.png

mehmet nedim akgül

ongelezen,
31 aug 2015, 10:22:4431-08-2015
aan
database name: veritabanim.mdb

table name: table1

columns names: "Column names while writing code should come from the outside.
Column names must act like we know not we"

mehmet nedim akgül

ongelezen,
31 aug 2015, 10:30:3331-08-2015
aan
SELECT Name FROM MSysObjects WHERE (Left([Name],1)<>'~') AND (Left([Name],4)<>'MSys') AND ([Type] In (1, 4, 6)) ORDER BY Name;

It makes me all the table names in the database listing these codes.

I want to list the names of the columns of this table like this.

Evertjan.

ongelezen,
31 aug 2015, 13:27:4731-08-2015
aan
mehmet nedim akgül <m.nedim...@gmail.com> wrote on 31 Aug 2015 in
microsoft.public.inetserver.asp.general:

> SELECT Name FROM MSysObjects WHERE (Left([Name],1)<>'~') AND
> (Left([Name],4)<>'MSys') AND ([Type] In (1, 4, 6)) ORDER BY Name;
>
> It makes me all the table names in the database listing these codes.

does it?

> I want to list the names of the columns of this table like this.

1 this is usenet, not email, do if you respond on something,you should quote
that like I do now.

What do you mena with "names of the columns", the contents of the fields,
or the name of the column, well you know that already, that is [Name]

3 "like this" like what? Please respond by giving some example of your
serverside code, and tell us where you go wrong.

> SELECT [Name] FROM MSysObjects WHERE (Left([Name],1)<>'~') AND
> (Left([Name],4)<>'MSys') AND ([Type] In (1, 4, 6)) ORDER BY Name;

MSysObjects is the name of a table, not the name of the database-file.
[Name] is the name of a field.
Show us how you want to loop through the records, using vbs or js.

Mehmet Nedim AKGUL

ongelezen,
31 aug 2015, 15:05:1331-08-2015
aan
----------------------------------------------------------------------------



<%
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("veritabanim.mdb"))
ssql="select column_name,* from information_schema.columns where table_name = 'tabloadi' order by ordinal_position;"
Set oRS = oConn.Execute(sSQL)

Do While NOT oRS.EOF

%>
<br>
<%

oRS.MoveNext
Loop

oConn.Close
Set oRS = Nothing
Set oConn = Nothing
%>


Script error detected at line 5.
Source line: Set oRS = oConn.Execute(sSQL)
Description: [Microsoft][ODBC Microsoft Access Driver] Could not find file 'C:\Users\nedim\Desktop\information_schema.mdb'.

Evertjan.

ongelezen,
31 aug 2015, 19:04:0831-08-2015
aan
Mehmet Nedim AKGUL <mnak...@gmail.com> wrote on 31 Aug 2015 in
microsoft.public.inetserver.asp.general:

> On Monday, August 31, 2015 at 8:27:47 PM UTC+3, Evertjan. wrote:
>> mehmet nedim akgül <m.nedim...@gmail.com> wrote on 31 Aug 2015 in
>> microsoft.public.inetserver.asp.general:
>>
>> > SELECT Name FROM MSysObjects WHERE (Left([Name],1)<>'~') AND
>> > (Left([Name],4)<>'MSys') AND ([Type] In (1, 4, 6)) ORDER BY Name;
>> >
>> > It makes me all the table names in the database listing these codes.
>>
>> does it?
>>
>> > I want to list the names of the columns of this table like this.
>>
>> 1 this is usenet, not email, do if you respond on something,you should
>> qu
> ote
>> that like I do now.
>>
>> What do you mena with "names of the columns", the contents of the
>> fields, or the name of the column, well you know that already, that is
>> [Name]
>>
>> 3 "like this" like what? Please respond by giving some example of your
>> serverside code, and tell us where you go wrong.
>>
>> > SELECT [Name] FROM MSysObjects WHERE (Left([Name],1)<>'~') AND
>> > (Left([Name],4)<>'MSys') AND ([Type] In (1, 4, 6)) ORDER BY Name;
>>
>> MSysObjects is the name of a table, not the name of the database-file.
>> [Name] is the name of a field.
>> Show us how you want to loop through the records, using vbs or js.

[please do not quote signatures on usenet]

> <%
> Set oConn = Server.CreateObject("ADODB.Connection")
> oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("veritabanim.mdb"))

> ssql="select column_name,* from
> information_schema.columns where table_name = 'tabloadi' order by
> ordinal_position;"

You cannot select a column-name like this
and the table-name has to be after the "from" keyword.

> Set oRS = oConn.Execute(sSQL)
>
> Do While NOT oRS.EOF
>
> %>
> <br>

What do you want to show here?

> <%
>
> oRS.MoveNext
> Loop
>
> oConn.Close
> Set oRS = Nothing
> Set oConn = Nothing
> %>
>
>
> Script error detected at line 5.

You do not show line numbers

> Source line: Set oRS = oConn.Execute(sSQL)
> Description: [Microsoft][ODBC Microsoft Access Driver] Could not find
> file 'C:\Users\nedim\Desktop\information_schema.mdb'.

However that error seems clear to me! The Database is not as described or
where described.

veritabanim.mdb
is not
information_schema.mdb

Try the ACE.OLEDB.12.0 driver:

======================
set CONNECT = server.CreateObject("ADODB.Connection")

CONNECT.Open "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" &_
Server.MapPath("/information_schema.mdb") & ";"

ssql = "...."

Set oRS = oConn.Execute(sSQL)
======================

========================
try this to get the column-names:

set rs = conn.Execute("select * from " & tableName)
for each column in rs.fields
Response.Write column.name & "<br>"
next
===============

Mehmet Nedim AKGUL

ongelezen,
1 sep 2015, 03:55:3801-09-2015
aan
------------------------------------------------------------------------
------------------------------------------------------------------------



<%
tableName="tabloadi"
set CONNECT = server.CreateObject("ADODB.Connection")
CONNECT.Open "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" &Server.MapPath("veritabanim.mdb") & ";"
ssql="select column_name,* from veritabanim.columns where table_name = 'tabloadi' order by column_name;"
Set oRS = CONNECT.Execute(ssql)

set rs = CONNECT.Execute("select * from " & tableName)
for each column in rs.fields
Response.Write column.name & "<br>"
next
CONNECT.Close
Set rs=Nothing
Set oRS = Nothing
Set CONNECT = Nothing
%>







Script error detected at line 5.
Source line: Set oRS = CONNECT.Execute(ssql)
Description: The Microsoft Office Access database engine cannot find the input table or query 'columns'. Make sure it exists and that its name is spelled correctly.

Evertjan.

ongelezen,
1 sep 2015, 04:13:1101-09-2015
aan
Mehmet Nedim AKGUL <mnak...@gmail.com> wrote on 01 Sep 2015 in
microsoft.public.inetserver.asp.general:

> <%
> tableName = "tabloadi"

Indeed it is a good thing to have table-names include
"tab" or "tbl" to discern them from fieldnames.
Additionally always use [] around fieldnames for the same reason,
(and to allow reserved words).

> set CONNECT = server.CreateObject("ADODB.Connection")

> CONNECT.Open "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE="
> & Server.MapPath("veritabanim.mdb") & ";"

change " to "_ at a new line.

the & ";" part is not strictly necesary anymore

???
> ssql="select column_name,* from
> veritabanim.columns where table_name = 'tabloadi' order by column_name;"
> Set oRS = CONNECT.Execute(ssql)
???

SKIP the part between the ??? ???, this has no output whatever,
and the ssql string is incorrect.

Please do not just copy and paste,
but analize the code and learn from that.


> set rs = CONNECT.Execute("select * from " & tableName)

> for each column in rs.fields
> Response.Write column.name & "<br>"
> next

???2
> CONNECT.Close
> Set rs=Nothing
> Set oRS = Nothing
> Set CONNECT = Nothing
???2

SKIP the part between the ???2 ???2 when on a ASP-webpage
not incorrect but when the web-page closes
this is done anyway on any decent modern IIS-version.

Oh, now I will be crushed by the last purists on this NG.


> %>

Mehmet Nedim AKGUL

ongelezen,
1 sep 2015, 04:39:4601-09-2015
aan
--------------------------------------------------------
--------------------------------------------------------
Thanks baby :)

<%

set CONNECT = server.CreateObject("ADODB.Connection")
CONNECT.Open "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" &Server.MapPath("veritabanim.mdb") & ";"
ssql="select column_name,* from veritabanim.columns where table_name = tblad;"
set rs = CONNECT.Execute("select * from tblad")
for each column in rs.fields
Response.Write column.name & "<br>"
next
%>

output:
id
name
sname
phone

Thank you for your help . Working at the moment.

Evertjan.

ongelezen,
1 sep 2015, 06:29:4101-09-2015
aan
Mehmet Nedim AKGUL <mnak...@gmail.com> wrote on 01 Sep 2015 in
microsoft.public.inetserver.asp.general:

> <%
>
> set CONNECT = server.CreateObject("ADODB.Connection")
> CONNECT.Open "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE="
> &Server.MapPath("veritabanim.mdb") & ";"

>ssql="select column_name,* from
> veritabanim.columns where table_name = tblad;"

Why this ssql line? It does not do a thing!!!

> set rs = CONNECT.Execute("select * from tblad")
> for each column in rs.fields
> Response.Write column.name & "<br>"
> next
> %>
>
> output:
> id
> name
> sname
> phone
>
> Thank you for your help . Working at the moment.
>



Mehmet Nedim AKGUL

ongelezen,
1 sep 2015, 07:08:0101-09-2015
aan
----------------------


Set oRS = CONNECT.Execute(sSQL)
it fails because this command.
Command was abolished and it worked .

Mehmet Nedim AKGUL

ongelezen,
1 sep 2015, 07:18:2901-09-2015
aan
-----------
ssql="select column_name,* from veritabanim.columns where table_name = tblad;"
I raised it

Mehmet Nedim AKGUL

ongelezen,
1 sep 2015, 08:56:3801-09-2015
aan
<%
response.write(session("tablo_adi"))
set CONNECT = server.CreateObject("ADODB.Connection")
CONNECT.Open "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" &Server.MapPath("veritabanim.mdb") & ";"
Set Tablom = server. CreateObject("ADODB.Recordset")
Tablom.Open session("tablo_adi"), CONNECT, 1, 3
Tablom.AddNew
set rs = CONNECT.Execute("select * from "& session("tablo_adi"))
i=1
for each column in rs.fields
Tablom(???????)=column.name
next
Tablom.Update
%>


Tablom(???????)=column.name
value ???: What should I write in this specified location ?

Mehmet Nedim AKGUL

ongelezen,
1 sep 2015, 09:56:2001-09-2015
aan
-------------------------------------
--------------------------------------

<%
response.write(session("tablo_adi"))
set CONNECT = server.CreateObject("ADODB.Connection")
CONNECT.Open "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" &Server.MapPath("veritabanim.mdb") & ";"
Set Tablom = server. CreateObject("ADODB.Recordset")
Tablom.Open session("tablo_adi"), CONNECT, 1, 3
Tablom.AddNew
set rs = CONNECT.Execute("select * from "& session("tablo_adi"))
i=1
for each column in rs.fields
Tablom(???????)=request(column.name)
next
Tablom.Update
%>


Tablom(???????)=request(column.name)

Evertjan.

ongelezen,
1 sep 2015, 10:07:0401-09-2015
aan
Mehmet Nedim AKGUL <mnak...@gmail.com> wrote on 01 Sep 2015 in
microsoft.public.inetserver.asp.general:

What do you want to accomplish,
that you cannot do without a recordset ?

Don't ever use a ADODB.Recordset,
until you know all the ins and outs of ADODB.Connection

Mehmet Nedim AKGUL

ongelezen,
2 sep 2015, 02:35:5302-09-2015
aan
----------------
I want to add records to the database .

Evertjan.

ongelezen,
2 sep 2015, 03:05:1302-09-2015
aan
Mehmet Nedim AKGUL <mnak...@gmail.com> wrote on 02 Sep 2015 in
microsoft.public.inetserver.asp.general:

>> What do you want to accomplish,
>> that you cannot do without a recordset ?
>>
>> Don't ever use a ADODB.Recordset,
>> until you know all the ins and outs of ADODB.Connection

[please do not quote signatures on usenet]

> I want to add records to the database .

There are days that I rather want someting too.

However, the ADODB.Recordset is not needed to add records.

The SQL "insert" command is enough.

Please read-up on SQL, this NG is no substitute for simple reading.

Don't ever use a ADODB.Recordset, until ... [see above]

Mehmet Nedim AKGUL

ongelezen,
2 sep 2015, 04:03:2202-09-2015
aan
for each column in rs.fields
SQLINSERT="INSERT INTO " &session("tablo_adi")& " "&" (" &column.name& ")" & "VALUES (" & request(column.name) & ") "
next

You write the correct use of it added ?

Evertjan.

ongelezen,
2 sep 2015, 04:20:0302-09-2015
aan
Mehmet Nedim AKGUL <mnak...@gmail.com> wrote on 02 Sep 2015 in
microsoft.public.inetserver.asp.general:

> for each column in rs.fields
> SQLINSERT="INSERT INTO " &session("tablo_adi")& " "&" (" &column.name&
> ")" & "VALUES (" & request(column.name) & ") "

sorry, this is far to complicated,
probably you will have to debug,
and I don't know what you plan to do,
and I am not going to quess.

It seems you are working with two different tables now?

Before each "next",
you would have to do an execute command:

set myData = myCommand.Execute(SQL)

> next


===============================

In general do this:

SQL = "blah blah etc etc"
response.write SQL & "<br>" : response.end
set myData = myCommand.Execute(SQL)

then, when you are satisfied that the SQL-string is as intended,
then remark-away the response.end like this

SQL = "blah blah etc etc"
response.write SQL & "<br>" : ''' response.end
set myData = myCommand.Execute(SQL)

and if all SQL's in the loop are correct
then remark-away the response.write like this:

SQL = "blah blah etc etc"
''' response.write SQL & "<br>" : ''' response.end
set myData = myCommand.Execute(SQL)


> You write the correct use of it added ?

Sorry, I don't understand the English of this sentence.

==========================

Mehmet Nedim AKGUL

ongelezen,
2 sep 2015, 04:48:4502-09-2015
aan
I want to transfer this data to the database

Mehmet Nedim AKGUL

ongelezen,
2 sep 2015, 05:17:4902-09-2015
aan
PAGE1:
<%
response.write(session("tablo_adi"))

set CONNECT = server.CreateObject("ADODB.Connection")
CONNECT.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("veritabanim.mdb"))
tblad=session("tablo_adi")
set rs = CONNECT.Execute("select * from "& tblad)
%>
<form action="tblveriekleonay1.asp" method="post">
<%
for each column in rs.fields

%>
<%=column.name%> &nbsp;<input type="text" name="<%=column.name%>"></br>
<%
next
%>
<input type="submit" name="gonder" value="kaydet">
</form>










PAGE:tblveriekleonay1.asp

<%
set CONNECT = server.CreateObject("ADODB.Connection")
CONNECT.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("veritabanim.mdb"))

set rs = CONNECT.Execute("select * from "& session("tablo_adi"))
for each column in rs.fields

!!! How do we transfer the entered text database

next


%>

Evertjan.

ongelezen,
2 sep 2015, 11:58:5802-09-2015
aan
Mehmet Nedim AKGUL <mnak...@gmail.com> wrote on 02 Sep 2015 in
microsoft.public.inetserver.asp.general:

> PAGE1:

This is not email, but usenet, so one to many posting.

You are not discussing according to the NG rules,
where you quote the significant part
of the posting you are responding on.

And you are not responding on my questions.

So I won't play anymore.
0 nieuwe berichten