PDA

Click to See Complete Forum and Search --> : ALTER TABLE in ADO


UKPhil
Apr 27th, 2000, 05:32 PM
Hi Guru's, can anyone help me with this ADO SQL command as I'm quite new to ADO. I'm trying to execute an ADD COLUMN query on a paradox table but keep getting the error:

"Unable to update table QBASE. Table in read-only database"

However, I am specifying read/write in the connection mode. Here is my code:

Dim strSQL As String
Dim cnQbase As New ADODB.Connection
Dim cmd As New ADODB.Command

strSQL = "ALTER TABLE QBASE2 ADD COLUMN STARTDATE DATE;"

cnQbase.ConnectionString = "Provider=MSDASQL.1;DSN=Paradox Files;DBQ=C:\CrewTrack\Data"
cnQbase.Mode = adModeReadWrite
cnQbase.Open
cmd.CommandText = strSQL
cmd.ActiveConnection = cnQbase
cmd.CommandType = adCmdText
cmd.Execute

Any help gratefully received. Thanks.

Apr 27th, 2000, 09:46 PM
Is the correct userID & Password set up in your odbc
DSN?

UKPhil
May 1st, 2000, 03:28 PM
There aren't any passwords or userID's for the database.

Clunietp
May 1st, 2000, 11:16 PM
I tried to alter a paradox db with ADO, and I also got a similar error..... now that I think about it, I've never been able to update a paradox or dbase IISAM database via ADO.....

UKPhil
May 1st, 2000, 11:50 PM
Reassuring to see that some else is having the same problem. I've pretty much tried everything that I can think of now and have pretty much given up on the idea, which is quite annoying as it sets my project back!!

Oh well, thanks to everyone who replied for their help.

Cheers