Forum > Database

MSSQL - TABLE READ ONLY AFTER CREATE

(1/2) > >>

lublinkermi:
Hi I have a problem with MsSQL Server 2008 using Zeos.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  ZConnection1.LibraryLocation:=ExtractFilePath(Application.ExeName)+'msdblibd.dll';  INI := TINIFile.Create(ExtractFilePath(Application.ExeName) + 'wfmag.ini');  serwer:=Ini.ReadString('polaczenie','host','localhost');  baza:=Ini.ReadString('polaczenie','baza','wfmag');  user:=Ini.ReadString('polaczenie','uzytkownik','root');  haslo:=Ini.ReadString('polaczenie','haslo_bazy','root');  snip:=Ini.ReadString('polaczenie','snip','root');  nrkontrah:=Ini.ReadString('polaczenie','nrkontrah','');  INI.Free;   If trim(serwer)='' then serwer:='localhost';  If trim (baza)='' then baza:='wapro';  If trim (user)='' then user:='sa';  If trim(haslo)='' then haslo:='Wapro3000';   Zconnection1.HostName:=serwer;  Zconnection1.Database:=baza;  Zconnection1.User:=user;  Zconnection1.Password:=haslo;  ZConnection1.Protocol:='FreeTDS_MsSQL-7.0';  try  Zconnection1.Connected:=true;   except  begin  showmessage ('Error MSSQL');  Application.Terminate;  end;  end ;  
I create table like this


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---wapro_uwagi.SQL.Text:='IF NOT EXISTS (SELECT  *    FROM     sysobjects';wapro_uwagi.SQL.Text:=wapro_uwagi.SQL.Text+' WHERE  name = ''uwagi'' AND xtype = ''U'') CREATE TABLE [dbo].[UWAGI]([uwagi_id] [int] IDENTITY(1,1) NOT NULL,[uwagi_kontrahent] [int]  NULL,[uwagi_data] [date] NULL,[uwagi_opis] [varchar](50) NULL,[uwagi_status] [smallint] NULL,[uwagi_tresc] [text] NULL,)';wapro_uwagi.ExecSQL;wapro_uwagi.SQL.Text:='select * from uwagi';wapro_uwagi.Open;   
Table has been crated, but is read only with any data controls like dbgrid, dbnavigator.
Then I use SQL Server Management Studio as a same user and password I can modify this table.

 What  can I do wrong?
Please help me.

paweld:
Sprawdź czy query (wapro_uwagi) nie jest ReadOnly

lublinkermi:
No any element has r/o attribute

miab3:
Use ZEOS 7.2 current (svn 3837) version.
http://zeoslib.sourceforge.net/viewtopic.php?f=40&t=3795&p=58049#p58049

Michal

korba812:
Maybe You should commit transaction after creating table?

Navigation

[0] Message Index

[#] Next page

Go to full version