473,378 Members | 1,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Retriving Table table name and field names

hi frnz,

In my coding i take the tablename and columns from the system and i execute the new query with that values.

if i give the table name directly it is working.but if i give the table in runtime it is not working.

here i send the the coding.help me to correct this prob.thanks advance for ur help


strqry="SELECT column_name FROM information_schema.`COLUMNS` C where table_name = '"&query1&"'"

RsSearch1.Open strqry,ObjConn, 2, 3
k=0
Do Until RsSearch1.EOF
k=k+1
cm_id(k)=RsSearch1("column_name")
RsSearch1.MoveNext
Loop

Set RsSearch2 = Server.CreateObject("adodb.recordset")


str2="select "&cm_id(1)&" from "& trim(query1) &" where " & cm_id(2) & " like '%" & str & "%' or " & cm_id(3) & " like '%" & str & "%' or "& cm_id(4) & " like '%" & str & "%'"

RsSearch2.Open str2,ObjConn, 2, 3


Error is on query1.it is table name.if i give it directly means it is working.but this coding not working.
Jul 4 '06 #1
0 1683

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Pato Secruza | last post by:
Hi everyone! I have a really frustrating error and need help. I’m trying to do a function that gets the properties and names of the fields in a MS Access database using ASP. I haven’t...
1
by: Randy | last post by:
Access= 2002 I'm NOT a Programmer, but I have used VB in the past to do some things ( Spaghetti Code King) so I have some understanding of Coding I need to replace a text field (teacher) in...
2
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg...
0
by: pchaitanya | last post by:
hi all, suppose in a table if i have columns namely name,entrydate now on retriving and binding to a gridview how can I get names rowwise and entrydate columnwise on a gridview on...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.