In the same way that you can create and alter permanent tables in Access 2000 using SQL in ASP ( CREATE TABLE <tablename> col_1(col_1 datatype), col_2(col_2 datatype....Col_n(col_n datatype)) is there any way to do this for Queries?
how to create new table which the table's name is variable. for example: i want to create table with the name is come from user's input in the form input.
<% Dim conn Set conn = Server.CreateObject("ADODB.Connection") conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("mydb.mdb")) 'conn.Open "DSN=Survey"
Dim strSQL ' Creates a table called survey3 strSQL = "CREATE TABLE survey3 (Q1 text(20),Q2 text(20));"
conn.Execute strSQL %> This code works..But before I create the table I need to check if it exists and only if it doesn't i want to create it...How can i do it?
I need to create a new table in an Access Db for a Db driven Classic ASP website. My concern is that if I alter my local copy of the Db and then simply upload it, data might be lost if any of the users are logged in and posting stats.
Is there a way for me to write and execute some code to add to the Db? In PHP I usually use sql statements with the PHP MyAdmin interface, but I don't know of such a thing for ASP-does it exist?
I am having a problem using the SQL statement "CREATE TABLE" for an SQL Server database. The code works right in Access but when it did not work in SQL Server 7, I changed some of the datatypes to match an SQL Server 7 generated script. The problem is, it still does not work!
Now the first comments will probably be something like, "make sure your SQL user has permission," or, "make sure your connection string is correct." I have already tested that - the connection string works and I used the DBO (sa) user. Code:
I am trying to use asp to create a new table in an existing database and I keep getting this error:
Microsoft JET Database Engine error '80040e14'
Syntax error in CREATE TABLE statement.
/install.asp, line 75
What would cause this?
Here is the code I am using:
Code: cnn.Execute("CREATE TABLE crosssale (prodID "&txtcl&"(50) NOT NULL,related "&txtcl&"(50) NOT NULL, PRIMARY KEY(prodID,related)") By the way txtcl equals: txtcl = "TEXT" 'access or txtcl = "NVARCHAR" 'sql
how do you create a table in MS Access from with an asp script? I will be creating the table name from Request.querystring("name"), also needs fields of branchname and branchcode. guess something like CREATE TABLE & Request.querystring("name") branchname. branchcode.
I have MS SQL Server as database. i want to create a new table in the DATABASE, through asp script, naming table's name and naming the fields with their data types.
Can i do this through an asp script, like it can be done through Database tools like Enterprise Manager??
Our users want to be able to copy and paste some numbers in a box which on Submit will display the corresponding status of those records. So for example a person A will paste in the box
1234 4567 43322 4353 56 2454 242
and on Submit we are palnning to build a select query ( select id,status from table where id in ( '1234' ,'4567' ,'43322' ,'4353'...) and display the output. Kindly suggest on how to proceed with this. Would appreciate it if you can provide the code for this as we are not good at classic ASP.( not at programming.
How can I loop through the values of one MSACCESS table to display the related records from another table? I have one table with two single field records. The values are 4 and 9. These fields are related to another table which contains records that belong to either 4 or 9.
I want my web page to display a table for all records belonging to 4 and then another table of all records that belong to 9. I could specify either 4 or 9 in different record collections but the 4 and 9 could one day be 1 and 5 and I don't want someone to have to get into my code to change the 4 and 9 to 1 and 5 in my sql queries. Any advice?
I have been looking everywhere, and can't find a complete function to create tables and columns in access .mdb from ASP, while adding columns that are missing in tables that already exist, can anyone post a link or the code to such function?
I am in the process of rewriting my table formats for an Access Project that was created. I now need to get the data from 1 table and transfer to a second table.
I created a page that creates the record set, I then loop through that record set and need to run an update statement to a second table, however, I get the following message:
Microsoft JET Database Engine (0x80004005) Could not use ''; file already in use. /BusPlanTest/updBusPlan.asp, line 17
I have an asp page that gives results for a search from a previous page from streetguide.streets in MySql. The page displays the UserName of the person logged in.
I have the results of this query displayed inside a form with hidden variables. When the user clicks "save to my folder" I want it to create a table in the mysql db with the same name as the user name, and then write to this table.
I have it working if I created the table beforehand, but I want the table to be created dynamically upon form submission with the table name to match the persons user name.
I have this code that retrieves the logged in users info. What I also need it to do is to display other records in the database that match the logged in users custnumber. Code:
Using regular VB ASP (not .net) and calling an Access database using ODBC, I've generated a recordset based a query... (no big whoop, obviously)
Now I want to be able to open a new XL spreadsheet (client side - we're assuming user has XL) and export that table to it. I've seen some posts about DoCmd.TransferSpreadsheet, and CreateObject("excel.application")... I've never actually used them before, so I don't know where to start.
I'd like to have a link on the page with the table to "export to XL"... and then have it open XL (client side) with that table in a spreadsheet.
i have written a stored procedure. depending upon different parameters, query is prepared as string and executed through exec() function. it returns a certain number of rows. stored procedure also contains a temporary table. the question is this how can i insert the rows returned by the query in to temporary table?
I want to retrieve a large number of rows from my database (Select SomeColumns from myDatabase)and then to fill a table with the retrieved data. What can i do?
I'm trying to figure out how to display a query generated table in a div through an "innerHTML=...." - not only can I not to get the table to generate more than one row, I can't populate the column/cells with any data from the query -
The asp's/vb script (which works fine as a standalone asp page) is: Code:
I am new to ASP and I want to use a query which links one record in a table to another record in the same table to display a list of values. The query lists the names of all managers (the managers staff no is held in the reports_to field of an employee)
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "SELECT DISTINCT p2.Surname + ', ' + p2.[First name] AS Expr1 FROM People p1 INNER JOIN People p2 ON p1.reports_to = p2.[Staff no] WHERE (p1.[Staff no] IS NOT NULL)",con,3,3 while not rs.EOF %> <option value="<%=rs("p2.surname")%></option> <% rs.MoveNext wend rs.Close
However it doesn't like the alias (p2). Is it possible to return a list from this type of query?
I want to do the following but am not able to do it.I have one query which is:
SQL2 = "SELECT * From totalcloser INNER JOIN zipcode ON totalcloser.zip = zipcode.zip order by totalcloser.zip"
I want to store result of this query in a temp table so that now i can go ahead and compare the results in the temp table with some other table.I know i can do this in Access..but i want to do this by coding (in my program itself) where the query runs and dumps the query results in temp table and then the second query runs and does comparisons and displays the result on screen.Towards the end ,we can flush the contents of the temp table.
I have aproblem to transfer a data from table x to table y based on id. Its mean when 2 table have same id all data table x must move to table y. I don't know which command need to use is it insert into or update?
<% Dim conn Dim rs Dim MYSQL,MYSQL2
Set conn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") Set cmd = Server.CreateObject("ADODB.Recordset") conn.ConnectionString = "DSN=prmm;UID=administrator;pwd=sa" conn.Open