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
===============