|
Hi! Tushar
I have tried with
rs.CursorType=adOpenDynamic
But of no use.
Pls. suggest.
regards
ranjita
|
|
|
|
|
Hi
If you want just to update the record in recordset then you have to set the fileds values of rs then call rs.update
If this method is not wirking the please relpy back then I will try some odd solution for you.
Regards
Tushar kothari
|
|
|
|
|
I wants to edit the existing record and then update.
what u r suggesting that i am using in the click event of my save button.
regards
ranjita
|
|
|
|
|
Hi
This is the tested code so please use it
Private Sub Form_Load()
Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sql As String
Set db = New ADODB.Connection
db.Provider = "SQLOLEDB"
db.ConnectionString = "Provider=SQLOLEDB.1;Password=thk;Persist Security Info=True;User ID=thk;Initial Catalog=Dhanavantari;Data Source=TUSHAR"
db.Open
Set rs = New ADODB.Recordset
sql = "Select * from WardMaster"
Set rs.ActiveConnection = db
rs.CursorLocation = adUseServer
rs.CursorType = adOpenDynamic
rs.LockType = adLockPessimistic
rs.Open sql, , , , adCmdText
End Sub
on Save client button
rs.Fields(1) = trim(txtwardname.text)
rs.Fields(2) = val(txtrate.text)
rs.Update
So now you can edit the recordset and then update it
ADO is the connected type of recordset so you can update one record at a time.
If you have some other problem which i had not understand the please brief it
regards
Tushar kothari
|
|
|
|
|
i am working in vb.net2.0 version.
can u help me with code that how can i populate the datagridview in edit mode which will open in another form when one selects the row of a datagridview.
regards
Taniya Banerjee
|
|
|
|
|
Hi,
I have a stored procedure with 1 parameter.
The value that I pass to the parameter is a select statement.
The question is how do I execute this select statement that is passed as parameter that returns the rows?
Thanks and Regards,
Uma
|
|
|
|
|
Hi,
You can use sp_executesql to execute the sqlquery which is in a variable.
Best Regards,
Apurva Kaushal
|
|
|
|
|
CReate proc test (@sName Char(4))
AS
BEGIN
SELECT col1 from table where name=@sname
end
To execute this
EXEC Test 'Amit'
Amit
|
|
|
|
|
Hi,
probably the question was that there is a sql statement which is there in the variable and how to execute that. Thats why I have given that solution. To execute a stored procedure is the same what you have given.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Say the user has a copy of her database (let’s call it MyData.mdb) on her PC. There is also a copy of that database on a central server website. Now what I want to do is have the user edit that database on her PC and then hit a “Synch” button, which will connect to the web server, updating the database there. I don’t want to have to re-upload the entire MyData.mdb every time What’s some industry methods for doing this? Can someone point me to a good article or tutorial? Thanks.
|
|
|
|
|
Use DTS and in SQL 2005 you have the flexbility to check whether this is new or updated record. We have done similar sort of operation for one of our project. but please note that is for xsl file to SQL server.
Amit
|
|
|
|
|
Send me some tips for ledger entries. Any one who had worked in ledgers, tell me that whether all voucher's data is sent to ledger? And all about ledgers?
thanks
Syed Shahid Hussain
|
|
|
|
|
Q. In SP's if one has to use some if...else condition with multiple sentances then how to use them....
Parag
|
|
|
|
|
I am not sure what you mean by "multiple sentances", but in sql server:
IF @value = 1
BEGIN
do something
END
ELSE
BEGIN
do something else
END
END IF
Mike Lasseter
|
|
|
|
|
SQL Server 2005 Books Online
IF...ELSE (Transact-SQL) [^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
hello,
can anybuddy plz tell me how we can use SQL Server 2000 on Windows XP pro. I'm working on a project that requires replication as well. For the moment, I'm working on Win 2000 Server and using Sql server 2000 enterprise ed. but I want to work on WinXP rather. So can u plz give me some solution to it. can we use Sqlserver 2000 professional edition or whatever on xp that also gives replication features.
Rocky
|
|
|
|
|
The Standard and Enterprise Editions will only install on Server-class operating systems (Windows 2000 Server, Advanced Server, Datacenter Server; Windows Server 2003 Standard Edition, Enterprise Edition, Datacenter Edition). On Windows XP the only production versions permitted are Workgroup Edition or Desktop Engine (MSDE).
MSDE can act as a replication subscriber but not as a publisher.
If all you're doing is testing out changes as a developer, it's fine to use the Developer Edition.
See SQL Server 2000 System Requirements[^] at microsoft.com.
|
|
|
|
|
well thanks for ur reply Mike. This shows that I gotta go with the server class OS here. Atfirst I also tried to go with windows server 2003 I dont remeber exactly what version was it but I found this really awful thing that sql server 2000 needs another service pack to run on it. This really looked awful to me so I went into using Win server 2000 and I think I gotta live with that coz I need those publishing features as well. But I can do without this good looking Windows XP.
thanks a lot
Rocky
|
|
|
|
|
Windows Server 2003 requires SQL Server 2000 SP3 or higher. You can however install the original release of SQL Server 2000 but should then install the service pack as soon as practical. The current service pack for SQL Server 2000 is SP4 and unless you have a very good reason to use an older version, you should run the latest service pack on a new installation, whichever operating system you're using.
SQL Server 2000 SP3 included many security fixes, including the patch for the Slammer worm. SP4 also incorporates a subsequent security patch, MS03-031.
I would recommend Windows Server 2003 over Windows 2000 on a new installation, not least because Windows 2000 is already out of mainstream support. Windows 2000 will continue to get security patches for another four years, but even so, Windows Server 2003 is a much more secure system.
|
|
|
|
|
well I would have used the new service pack for sure but the problem here is that I cant find them in the market and now I'm tryin to download that from internet. I hope it works fine...
cheers
|
|
|
|
|
well now I'm trying to download the SP4
but I was just thinking abt SQL server 2005 now. I'm a bit inexperienced in these things but is it safe to convert to SQL server 2005. Which edition would I need to have for replication to work in its full strength.
is it a good option for me to convert now to Sql serv2005?
Rocky
|
|
|
|
|
My database has grown so much that I cant fit the database and the back(BAK file) on the same hard drive. I have tried to place the BAK file on our NAS Server and do a test restore from there. This did not work. Here is the proceedue I am using.
------------------------
Restore FileListOnly
From Disk = '\\server_nas\TSW_Resort\TSWDataBackUp'
Restore Database TSWData
From Disk = '\\server_nas\TSW_Resort\TWDataBackUp'
With Move 'W_Data' To 'D:\Data\TSData_Data.mdf',
Move 'W_Log' To 'D:\Data\TSData_Log.ldf',
Replace
-----------------------
This didt not work either. Everytime I try to restore from the UNC path I get a device off line error. I have also checked my SQL Server Agent to make sure the credentials will allow it access to that file path.
The last thing I have tried was to give the UNC path the address of the Mapped drive
\\server_nas\G$\TWDataBackUp
however that did not work either.
I am using SQL Server 2000 and Windows Server 2003.
Does anyone have any idea on how to do a restore. Any help would be appreciated
Thanks
|
|
|
|
|
oskardiazdeleon wrote: Does anyone have any idea on how to do a restore. Any help would be appreciated
You cannot backup and restore across a network. The backup device, including a hard disk, must be physically attached to the SQL Server.
|
|
|
|
|
I'm starting a project to convert from a JET databse to an MS SQL database. The application using the data is written in VB 6. On the surface the conversion looks strait forward. Anyone know of any minefields I'm going to run into?
Thanks,
Nick
|
|
|
|
|
I imagine most (if not all) of the SQL in the VB6 app will work just as well with no change on a MS SQL backend.
Of course, you will need a new connection string.
The OleDb adapters, readers etc should work with MS SQL too. Though you will probably want to change them to SQLAdapters etc.
Some saved queries (Access/JET) will need to be converted to MS SQL stored procedures, functions etc.
May want to look through the code for any Access/JET automation code that may be used to do things like show reports etc.
Other than that, I'd be interested to know what you found myself!
Steve
|
|
|
|