ASP + SQL Create Table For SQL Server
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:
View Replies
ADVERTISEMENT
Here's what my code looks like...
View Replies
View Related
I know I can Create Tables In a database with the CREATE TABLE sql statment, but I don't exactly know the syntax of the statment.
I want to add a table with a sertin feild that has a default value, is that possible?
The syntax I know is:
sql = "CREATE TABLE tablename(feildname FEILDTYPE,feildname FEILDTYPE...)"
Are there any other parameters that I can add to the statment?
View Replies
View Related
I'm writing an ASP app to create a table in an MS Access database. I use:
Code:
sql = "CREATE TABLE success(name text (50), company text (75), article memo (), img text (50))"
and get a syntax error. When I remove the "article" field and param, it works. Even when I add a max char param inside the parenthesis
Code:
article memo (255),
I get the same error. Doesn't the "memo" data type allow unlimited charactors? If so, is there a param that I need to add to the memo () call?
View Replies
View Related
how to tell access to allow a zero length and put a default value now() in the date/time field in SQL?
View Replies
View Related
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.
create table <table's name variable> ( ...
View Replies
View Related
Can you create a table in an access database using create_table?
View Replies
View Related
Code:
<%
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?
View Replies
View Related
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?
View Replies
View Related
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
View Replies
View Related
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?
View Replies
View Related
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.
View Replies
View Related
how do i create a td for each field in my rs, with out labeling them. this is what i have, not sure if i'm heading in the right direction or not.
Code:
<table>
<tr>
<%Do while not rs.eof%>
<td>
<%= rs ('insert rs name'<<<<???)%>
</td>
<%rs.movenext
loop%>
</tr>
</table>
View Replies
View Related
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??
View Replies
View Related
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?
View Replies
View Related
I need to do a simple but complex thing...
For every record is my users table, I need it to creating a record in 3 tables, with one value (all the same)...
So, in detail:
1 users table
Need to create a record in 3 other tables with the userid from the record it added...
e.g.
From record 1 in Table A, create a record in Table B, C, and D with the value of field 'userid' the value of the 'userid' field from Table A...
Get it?
View Replies
View Related
I'm trying to dynamicly create a table in an existing ACCESS database. Code:
View Replies
View Related
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?
View Replies
View Related
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
Below is the code I am using: Code:
View Replies
View Related
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.
View Replies
View Related
How many Max Cookies can we Create in Server.
View Replies
View Related
I want to generated a csv file from sql server table, in which I would like to create a asp page which display a field list with a check box.
Then whatever check box I selected, and click on generate button, then a CSV text fill will generate depending on sellected field with the field header and uploaded to FTP server.
View Replies
View Related
I have an asp page with a table filled with data from sql server table. I want the user to be able to update the records in this page itself. for example, if user clicks on a cell, it should allow the user to change the content and then be able to update the sql table with these new updated values. I know there is this editable content feature to use to make a cell editable, but iam kinda stuck on how to retrive the updated values and insert/update them to the sql table.
View Replies
View Related
How can I create new folders on the server, via ASP programming, which automatically allows by any user:
1. Files to be browsed
2. Anonymous upload to this directory
3. Allow uploaded files to over-write the existing file
I use the following ASP codes to create new folders, but all above options are off and I cannot e.g., upload (via ASP programming) to upload a file in the new directory because the option is off.
Set fs = CreateObject("Scripting.FileSystemObject")
set b = fs.CreateFolder(newFolder)
View Replies
View Related
I need to dynamically create subdomains, or folders, on my site. I am currently developing a portal where when the person registers he/she gets their own sub-domain on my site. Either that or I need to create a subfolder for them on the site. I am developing in ASP and need some advice/help urgently.
View Replies
View Related
Is there a way to find and display the creation or last modified date for a SQL server table? I want to put a date on my site of when the table was last updated. I am using ASP.
View Replies
View Related
I have a table with 30 or so columns. I'm pulling the data and putting them into variables like so:
objRS.Open query, db
UserID = objRS("UserID")
That's obviously not including the db conn info or even the query itself. Rather than manually typing out each and every variable and pulling the data from the RS object, is there a function that will automatically store all the data from the RS into its respective variable? I'm basically just lazy and the carpal tunnel kicked in after 10 or so variables.
View Replies
View Related
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
startdate=request("tarikh1")
enddate=request("tarikh2")
MYSQL = "SELECT * FROM table_x where paymentdate between '" & tarikh1 & "' and '" & tarikh2 & "'"
rs.open MYSQL,conn ....
View Replies
View Related
I am trying to display the content of a Table called
'Order Detail' directly from the database (e.g., Northwind.mdb). I have the following commands:
Set tableSet = Server.CreateObject("ADODB.Recordset")
tableSet.Open table_name, DB_name, adOpenForwardOnly, _
adLockOptimistic, adCmdTable
where, table_name = ''Order Detail" Or
table_name = 'Order Detail' Or different variations.
I always get error on the second command with the following message:
Syntax error in query. Incomplete query clause
which I believe because of space in the Table Name. How can I resolve this issue? (working with file or table name with space)?
View Replies
View Related
I have a table with many txt boxes which i have inside a form with a submit button to an update page which adds all the details to a db. The problem is i have a another table inside the first e.g. table 2. i want to be able to update table2 by clicking a second submit button that would update it. Is it possible to have a form within a form or how can i do it??
Also i need to update the entire table in one go. For exampple if i have 3 records in table2 i want to be able to update them all by clicking the one update button. Code:
View Replies
View Related
I have the following code but this is inserting manually. I want to make a query from table 1 and automatically enter the records into table 2. What needs to be modified? Code:
View Replies
View Related
Have an app which dynamically creates table rows depending on records, these can be several hundred (don't ask). Hence a very long page at time. Each row includes a hyper link to a new page, and a link back to the original page.
Is there any method (maybe via js) where on leaving the second page l can redirect the browser to the table row the end user clicked on? Hence the bookmarking. Can do this via Visual Basic on the desktop app, but can't work it out on the web app.
View Replies
View Related
I have a table produced with names across the top and services down the left hand side with boxes for numbers for people who recieve services then the info is written into a table in an access db. That works fine and here is that code:
View Replies
View Related