Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting relationships through asp

Status
Not open for further replies.

storm1976

Programmer
Jul 6, 2001
31
GB
Yes it seems a bizarre subject but unfortunately dont know where to put it.

Ok heres the scenario.

I uploaded a database to our website a few months ago, with many tables in some related. There were also tables which were empty for future development.

So now it has come round to the time to work on these tables. However, there is a relationship between two tables which needs to be deleted.

The question is: is there a way of deleting a relationship using asp and sql or would i need to download the database and delete it manually?

Cheers in advance

 
You can execute any valid SQL statement via asp so long as you have the correct permission.

sql = "DROP TABLE tableName"
sql = "DROP INDEX indexName"


cn.execute(sql)

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
thanks for the quick mwolf00

but its is just the relationship to be deleted.

i have tested it out our local version and comes up with an error.

Error Type:
Microsoft JET Database Engine (0x80004005)
Cannot delete this index or table. It is either the current index or is used in a relationship.

is this down to bad database design?


 
I'd have to brush up on my SQL, but I think that you may need the "ALTER TABLE" command with an "ON DELETE CASCADE". Read up on it first or ask in the SQL Server forum183

Here's the Microsoft info on it...


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
unfortunately am still on access

any ideas where is shoudld post it?
 
forum701

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top