473,382 Members | 1,376 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,382 software developers and data experts.

Modify Table Using Code

Hi All,

I have a huge MS Access database in which requests are added at regular basis as in almost every minute.I have to modify the data type of one of the coloumns in this database,but i cant copy the database to my system and make this change and then put it back.So i want to make the changes through ASP code.I had written the following code to do the same but this is not working.

Expand|Select|Wrap|Line Numbers
  1. <%@Language=VBScript
  2. Dim conn,rs,sConnection
  3.     Set conn=Server.CreateObject("ADODB.Connection")
  4.     sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
  5.     "Data Source=" & Server.MapPath("../fpdb/taxireq.mdb") & ";" & _
  6.     "Persist Security Info=False"
  7.     conn.Open(sConnection)
  8.  
  9. conn.execute("ALTER TABLE Request_detail MODIFY Namecon Memo")
  10. response.write("done")
  11. conn.close
  12. %>
  13.  
In the above code i want to change the data type of column "Namecon" from Text to Memo type because text type has limitation of storing only 255 characters.

Please suggest some changes which would help me in making the required change

Thanks in advance!!
Sep 23 '08 #1
2 1677
shweta123
692 Expert 512MB
Hi,

In order to alter the table using code you have to make the following change in the query :

conn.execute("ALTER TABLE Request_detail alter column Namecon Memo")



Hope this helps.
Sep 23 '08 #2
DrBunchman
979 Expert 512MB
Hi priyammaheshwari,

I wouldn't advise changing the structure of your database through code while it is live - this could lead to all sorts of knock on problems that would suddenly affect your live users.

Of course, you might have already done this and nothing happened but I'd suggest finding some time to down the live system and testing the effect of the changes after you've made them before putting it back up.

Just my two pence worth!

Dr B
Sep 26 '08 #3

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

Similar topics

1
by: Franco Fellico' | last post by:
Hi. Suppose to have read and displayed (using PHP) a group of row of a DB table on a dinamyc table on a HTML/PHP page. The number of row displayed could be from 1 to n. Each row contains...
2
by: Got2Go | last post by:
Hello, I am trying to come up with a function that will search the source of the page for a specific string. If that string is found, then have it modify specific tags inside of a table and...
2
by: karenmiddleol | last post by:
The following code works fine I can connect to a SQL database and list all the records in the Orders table onto a web page. Now our users want me to modify it so that each row displayed as a...
4
by: John | last post by:
I am using code provided by Mr. Steele that allows for my MDB to dynamically connect to remote SQL server databases. The code works fine as follows: Type TableDetails TableName As String...
1
by: Henry | last post by:
Hi. I've been trying to modify my dataset and have been unsucessful. Any help would be great. What I have is a dataset in a session variable. Here is what I have done to stored into the dataset...
4
by: lesperancer | last post by:
it looks like this will save many versions of a relationship window, but based on the fact that the same tables are displayed in the relationship window and it will restore versions of what was...
4
by: mimasci | last post by:
Hi, I have tried to write a code that allowed me to modify the value of the cells selected in a table, with excel has been easy. How one approaches selected cells? (To modify the value) How...
4
by: Bob | last post by:
Hi all, I'm trying to import data, modify the data then insert it into a new table. The code below works fine for it but it takes a really long time for 15,000 odd records. Is there a way I...
1
by: macupryk | last post by:
Need to modify the stored proc where we can add the REP_NAME. to an existing crystal report. I will also need to order by REP_NAME and group by REP_NAME. Many customer id's can belong to one Sales...
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: 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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.