Showing posts with label studio. Show all posts
Showing posts with label studio. Show all posts

Friday, March 23, 2012

recovering file from report server

Hi
Is it possiable to recover a .rdl file from the report server? I deleted a
report file from Visual Studio, but it was succesfully published to the
report server.
Any help is appreciated.
thanksImRhcndpbiIgPGRhcndpbkBkaXNjdXNzaW9ucy5taWNyb3NvZnQuY29tPiB3cm90ZSANCj4gSXMg
aXQgcG9zc2lhYmxlIHRvIHJlY292ZXIgYSAucmRsIGZpbGUgZnJvbSB0aGUgcmVwb3J0IHNlcnZl
cj8gIEkgZGVsZXRlZCBhIA0KPiByZXBvcnQgZmlsZSBmcm9tIFZpc3VhbCBTdHVkaW8sIGJ1dCBp
dCB3YXMgc3VjY2VzZnVsbHkgcHVibGlzaGVkIHRvIHRoZSANCj4gcmVwb3J0IHNlcnZlci4NCmdv
IHRvIHRvIHlvdXIgcmVwb3J0IHNlcnZlciANCjxzZXJ2ZXIgbmFtZT4vUmVwb3J0cw0KZmluZCB5
b3UgcmVwb3J0DQpvcGVuIGl0IA0KYW5kIGluIHByb3BlcnRpZXMgdGFiIHlvdSdsbCBmaW5kIGVk
aXQgYnV0dG9uLCBwcmVzcyBpdCBhbmQgeW91J2xsIGdldCB5b3UgcmRsIGZpbGUu|||As well as Report Manager you can also use Reporting Services Scripter. If
you need to get multiple reports from the server this will be quicker
http://www.sqldbatips.com/showarticle.asp?ID=62
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"darwin" <darwin@.discussions.microsoft.com> wrote in message
news:792A43C5-18E9-478E-B086-BC6639880020@.microsoft.com...
> Hi
> Is it possiable to recover a .rdl file from the report server? I deleted
> a
> report file from Visual Studio, but it was succesfully published to the
> report server.
> Any help is appreciated.
> thanks|||Thanks to you both. I was rather a bit nervous thinking I would have to
reproduce that report from scratch. Jasper, Thanks for the code link. And a
new site to read!
;)
"Jasper Smith" wrote:
> As well as Report Manager you can also use Reporting Services Scripter. If
> you need to get multiple reports from the server this will be quicker
> http://www.sqldbatips.com/showarticle.asp?ID=62
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "darwin" <darwin@.discussions.microsoft.com> wrote in message
> news:792A43C5-18E9-478E-B086-BC6639880020@.microsoft.com...
> > Hi
> >
> > Is it possiable to recover a .rdl file from the report server? I deleted
> > a
> > report file from Visual Studio, but it was succesfully published to the
> > report server.
> >
> > Any help is appreciated.
> > thanks
>
>

Wednesday, March 21, 2012

Recovering database from Transactional Log File(.ldf file)

Hi

I am in a trouble without doing any mistake. I restarted while in parallely my sql server was restarting i.e I opened a management studio.

When it booted up next time. I see that my database is gone. Though it is showed up in the server but has no node below it.

I then checked the mdf files and ldf files and found mdf file to be of 0 KB and ldf file is of 1.73 GB. My database was in full recovery mode but i did not take any database backup.

Here ais the entry from my SQL server log:

The operating system returned error 38(Reached the end of the file.) to SQL Server during a read at offset 0000000000000000 in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Hello.mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

I wonder if now there is a case to recover my database..Can I restore/recover the database from .ldf file as it was in full recovery model?Any help i shighly appreciated.It is not possible to recover the mdf file with ldf alone. The transaction log files holds the log information that is used to recover the database. MDF is the data file which contains the startup information for the database and points to the other files in the database. User data and objects will be stored in this file.|||

The LDF file would be the log file of the database. There is no way from SQL Server to recover a database from the LDF file alone. However you could try other tools such as:

Lumigent Log Explorer

Red Gate

The above have tools to read SQL Server Database LDF files and might be of some help to you.

|||

As mentioned by vidya and amit its not possible to restore database from LDF. This is the significance of Backups. You have to have Backup of all the database which can be easily scheduled. In this case though your db is in FULLRecovery model, you have to have a base line(full) backup to restore the database. I don't think any tool can help you on this.

Madhu

|||I have the LDF file and the database file (MDF). The MDF file is 2 days old then ldf file. Is there any way, I can apply all the transaction for these 2 days.

Rajeev

Recovering a file

Hi,

I am working on SQL Server Business Intelligence Development Studio - 2005. While working on the same, the studio got closed automatically and I was not able to save my existing file.

When I try to open the last saved file, it is thowing the following error:

Deserialization failed: The element 'QueryParameter' in namespace 'http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition' has incomplete content. List of possible elements expected: 'http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition:Value ##other:*'. Line 277, position 12.

EDIT CODE

Now I am not able to open the file. Please let me know how can I recover the lost file.

Regards
Syed

The QueryParameter nodes exist for each dataset you have in your report, and determine what parameters from the UI are used in each of those datasets. What you can do is just open your report in an XML editor, find the QueryParameter node at or around line 277, and either manually fix it up (give it a name, and empty value and ensure it has a closing tag), or just delete the whole node. Make sure you keep the rdl extension on the file when you save it, that should fix your problem.

Tuesday, March 20, 2012

Recover RDL file

Hello,
I've got a huge problem with SQL Server 2005. I've lost the RDL file built
with SQL Server BI Studio (developper hard disk format, with no backup), and
the only thing that I've got now is the server itself, with the ReportServer
database.
Is it possible to re-create a RDL file from the tables in this database?
Thanks for your help.
JN.In report manager click on the report, properties tab, click the edit button
under Report Definition. Give is a local directory (different from where the
project will be). Then create a new project and add and existing item to it.
It will copy the rdl over into the project directly. Not very discoverable
but works as advertized.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Jean-Nicolas BERGER" <j-n.enlevezmoi.berger@.club-internet.fr> wrote in
message news:O3BwKmCMHHA.3668@.TK2MSFTNGP02.phx.gbl...
> Hello,
> I've got a huge problem with SQL Server 2005. I've lost the RDL file built
> with SQL Server BI Studio (developper hard disk format, with no backup),
> and the only thing that I've got now is the server itself, with the
> ReportServer database.
> Is it possible to re-create a RDL file from the tables in this database?
> Thanks for your help.
> JN.
>

Friday, March 9, 2012

Recover a deleted SQL Express database

One of my SQL Express databases was deleted by mistake through MS SQL Server Management Studio Express. It is not in the Recycle Bin and I have tried to use a tool such a Active@. Undelete to recover the file but it cannot find the deleted file.

I have a backup file *.bak in the ...MSSQL\Backup folder I made using MS SQL Server Management Studio Express. When I try to use the restore database feature in SSMSE I get various errors.

Any Suggestions on how to recover the deleted file or

Any suggestions or documentation on using the restore feature in SSMSE?

Any help at all?

Thanks

George

You are in luck you have a .bak use the link below to download the eval version of SQL Server install it as a named instance and right click at the top of management studio and register the Express. Then use the Backup and restore wizard to restore in .bak to recreate your database. In the Backup and Restore wizard choose the restore from device option. Post again if you need more help.

Hope this helps.

http://www.microsoft.com/sql/downloads/trial-software.mspx

|||

Does anyone know why I can't recovery a deleted SQL Database file like I can most other deleted files. Is there something special about this file. I can't believe someone hasn't developed a procedure or application that can do this.

In addition is there a known error in SSMSE that prevents it from restoring a backup made with SSMSE through SSMSE.

Frustration is mounting!

Thanks

George

|||

The reason is database files are system files when you delete it you are undoing a task so there is no file to recover. That is the reason you use either the.bak which is the best or Transaction Log to recover. Run a search for SQL Server recovery in the BOL (books online).

There is nothing preventing it from recovering but you need the Backup and Restore Wizard which is part of Management Studio to do the Restore. That is the reason I gave you the Eval version or you could buy the developer edition it is about $32 on the web.

Hope this helps.

|||

Can I install the eval version of SQL Server on my XP Pro machine. At the present I do have access to a Window Server 200X. If so what will it conflict with the SQL Express that I have installed?

Thanks for you help.

George

|||

Yes you can the eval is Microsoft way of getting users comfortable with the product so SQL Server 2005 eval almost self install after you choose components please choose all components. One more thing the reason you need the Backup and Restore Wizard is when you choose the restore from device option SQL Server chooses the file part for you through the .bak file so you need the Wizard and it is part of Management Studio.

There is no conflict just install the eval as named instance right click at the top of Management Studio and register the Express so you it becomes local to the eval which is Enterprise edition and choose restore from device option in the Backup and Restore Wizard. Post again if you need more help. Hope this helps.

|||

Thanks, for your patience and explanation. I have restore from the backup. I was able to restore it through SQL Server Manager Express, as advertized.

George

Saturday, February 25, 2012

Records are not listed in order

Hi,
When I used SQL Server Management Studio to open several tables (SQL 2005),
some records are not listed in the order - for example, listed by orderid,
customerid, or so on.
Is there a way that I can have them listed in order?
Many thanks in advance.Hi,
If you do not have a clustered index then data will be displayed based on
the way it gets stored. If you want
any specific order / any batch seeks then go for a clustered index based on
the requirement.
Thanks
Hari
SQL Server MVP
"xfile" <cou-cou@.remove.nospam.com> wrote in message
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||The ANSI SQL standard states that data will not be stored in any particular
order.
The exception is when there is a 'clustered' index, in which case the data
is ordered by the index.
Always add a [ORDER BY] clause to your queries to retrieve data in a
determined order.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"xfile" <cou-cou@.remove.nospam.com> wrote in message
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||Hi,
Thanks for both of your explanations.
Just to ensure that I understood correctly, what you meant is that it's
perfectly normal for records not displaying in any particular order if
tables are opened with tool such as Management Studio?
If I wish to have it displayed in any particular order, it has be done by
using queries either by writing one or done with application or tools.
Just one final question about the SQL Server Management Studio and that is,
does it come with any functions similar in Access that can with one click to
have data displaying ascending (A-Z) or descending (Z-A)?
Many thanks.
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:%23OLHKNZxGHA.1272@.TK2MSFTNGP05.phx.gbl...
> The ANSI SQL standard states that data will not be stored in any
> particular order.
> The exception is when there is a 'clustered' index, in which case the data
> is ordered by the index.
> Always add a [ORDER BY] clause to your queries to retrieve data in a
> determined order.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "xfile" <cou-cou@.remove.nospam.com> wrote in message
> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>|||xfile wrote:
> Hi,
> Thanks for both of your explanations.
> Just to ensure that I understood correctly, what you meant is that it's
> perfectly normal for records not displaying in any particular order if
> tables are opened with tool such as Management Studio?
> If I wish to have it displayed in any particular order, it has be done by
> using queries either by writing one or done with application or tools.
That's right.
Just to expand on what Hari and Arnie said. A clustered index
implements some ordering in an internal index structure (not
necessarily at the level of the data rows or data pages) but it does
not directly control the order in which row will be returned from a
query. For that you need to use an ORDER BY clause.

> Just one final question about the SQL Server Management Studio and that is
,
> does it come with any functions similar in Access that can with one click
to
> have data displaying ascending (A-Z) or descending (Z-A)?
>
No. SSMS is a management tool. It isn't really designed with that kind
of application in mind. Returning every row and then dynamically
sorting them wouldn't be a very sensible feature to have in a client
server environment.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||You can right click on the column and select Pane > Criteria to sort the
result.
KL.
"xfile" <cou-cou@.remove.nospam.com> skrev i meddelandet
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||You can only guarantee the order of the results by using an
order by clause in the SQL statement.
There is no A-Z or Z-A functionality in SQL Server - that's
just a MS Access thing. All it does is an order by "under
the covers" for you.
When you use an order by clause, you can specify ASC for
ascending or DESC for descending. If you don't specify the
ordering, ASC is the default that will be used.
-Sue
On Tue, 22 Aug 2006 15:50:27 +0800, "xfile"
<cou-cou@.remove.nospam.com> wrote:

>Hi,
>Thanks for both of your explanations.
>Just to ensure that I understood correctly, what you meant is that it's
>perfectly normal for records not displaying in any particular order if
>tables are opened with tool such as Management Studio?
>If I wish to have it displayed in any particular order, it has be done by
>using queries either by writing one or done with application or tools.
>Just one final question about the SQL Server Management Studio and that is,
>does it come with any functions similar in Access that can with one click t
o
>have data displaying ascending (A-Z) or descending (Z-A)?
>Many thanks.
>
>"Arnie Rowland" <arnie@.1568.com> wrote in message
>news:%23OLHKNZxGHA.1272@.TK2MSFTNGP05.phx.gbl...
>|||Hi,
Thanks again for all of your kind explanations.
I did find the pane-criteria, and tried a few times and happy with the
results even I have to add all columns into criteria.
I am totally unfamiliar with database and accustomed to Access simple
graphic interface. We started using SQL 2000 last year (from hosting
company) and all queries are built-in with applications, and we recently
upgraded to a new version of the application and also moved to SQL 2005.
SQL 2005 is fast!!!
The purpose is to open some tables and delete testing data.
Again, many thanks for all of your kind explanations.
"KL" <noname@.nowhere.com> wrote in message
news:OWDzCvexGHA.980@.TK2MSFTNGP04.phx.gbl...
>
> You can right click on the column and select Pane > Criteria to sort the
> result.
> KL.
>
> "xfile" <cou-cou@.remove.nospam.com> skrev i meddelandet
> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>

Records are not listed in order

Hi,
When I used SQL Server Management Studio to open several tables (SQL 2005),
some records are not listed in the order - for example, listed by orderid,
customerid, or so on.
Is there a way that I can have them listed in order?
Many thanks in advance.Hi,
If you do not have a clustered index then data will be displayed based on
the way it gets stored. If you want
any specific order / any batch seeks then go for a clustered index based on
the requirement.
Thanks
Hari
SQL Server MVP
"xfile" <cou-cou@.remove.nospam.com> wrote in message
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||The ANSI SQL standard states that data will not be stored in any particular
order.
The exception is when there is a 'clustered' index, in which case the data
is ordered by the index.
Always add a [ORDER BY] clause to your queries to retrieve data in a
determined order.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"xfile" <cou-cou@.remove.nospam.com> wrote in message
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||Hi,
Thanks for both of your explanations.
Just to ensure that I understood correctly, what you meant is that it's
perfectly normal for records not displaying in any particular order if
tables are opened with tool such as Management Studio?
If I wish to have it displayed in any particular order, it has be done by
using queries either by writing one or done with application or tools.
Just one final question about the SQL Server Management Studio and that is,
does it come with any functions similar in Access that can with one click to
have data displaying ascending (A-Z) or descending (Z-A)?
Many thanks.
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:%23OLHKNZxGHA.1272@.TK2MSFTNGP05.phx.gbl...
> The ANSI SQL standard states that data will not be stored in any
> particular order.
> The exception is when there is a 'clustered' index, in which case the data
> is ordered by the index.
> Always add a [ORDER BY] clause to your queries to retrieve data in a
> determined order.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "xfile" <cou-cou@.remove.nospam.com> wrote in message
> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>> Hi,
>> When I used SQL Server Management Studio to open several tables (SQL
>> 2005), some records are not listed in the order - for example, listed by
>> orderid, customerid, or so on.
>> Is there a way that I can have them listed in order?
>> Many thanks in advance.
>|||xfile wrote:
> Hi,
> Thanks for both of your explanations.
> Just to ensure that I understood correctly, what you meant is that it's
> perfectly normal for records not displaying in any particular order if
> tables are opened with tool such as Management Studio?
> If I wish to have it displayed in any particular order, it has be done by
> using queries either by writing one or done with application or tools.
That's right.
Just to expand on what Hari and Arnie said. A clustered index
implements some ordering in an internal index structure (not
necessarily at the level of the data rows or data pages) but it does
not directly control the order in which row will be returned from a
query. For that you need to use an ORDER BY clause.
> Just one final question about the SQL Server Management Studio and that is,
> does it come with any functions similar in Access that can with one click to
> have data displaying ascending (A-Z) or descending (Z-A)?
>
No. SSMS is a management tool. It isn't really designed with that kind
of application in mind. Returning every row and then dynamically
sorting them wouldn't be a very sensible feature to have in a client
server environment.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||You can right click on the column and select Pane > Criteria to sort the
result.
KL.
"xfile" <cou-cou@.remove.nospam.com> skrev i meddelandet
news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
> Hi,
> When I used SQL Server Management Studio to open several tables (SQL
> 2005), some records are not listed in the order - for example, listed by
> orderid, customerid, or so on.
> Is there a way that I can have them listed in order?
> Many thanks in advance.
>|||You can only guarantee the order of the results by using an
order by clause in the SQL statement.
There is no A-Z or Z-A functionality in SQL Server - that's
just a MS Access thing. All it does is an order by "under
the covers" for you.
When you use an order by clause, you can specify ASC for
ascending or DESC for descending. If you don't specify the
ordering, ASC is the default that will be used.
-Sue
On Tue, 22 Aug 2006 15:50:27 +0800, "xfile"
<cou-cou@.remove.nospam.com> wrote:
>Hi,
>Thanks for both of your explanations.
>Just to ensure that I understood correctly, what you meant is that it's
>perfectly normal for records not displaying in any particular order if
>tables are opened with tool such as Management Studio?
>If I wish to have it displayed in any particular order, it has be done by
>using queries either by writing one or done with application or tools.
>Just one final question about the SQL Server Management Studio and that is,
>does it come with any functions similar in Access that can with one click to
>have data displaying ascending (A-Z) or descending (Z-A)?
>Many thanks.
>
>"Arnie Rowland" <arnie@.1568.com> wrote in message
>news:%23OLHKNZxGHA.1272@.TK2MSFTNGP05.phx.gbl...
>> The ANSI SQL standard states that data will not be stored in any
>> particular order.
>> The exception is when there is a 'clustered' index, in which case the data
>> is ordered by the index.
>> Always add a [ORDER BY] clause to your queries to retrieve data in a
>> determined order.
>> --
>> Arnie Rowland, Ph.D.
>> Westwood Consulting, Inc
>> Most good judgment comes from experience.
>> Most experience comes from bad judgment.
>> - Anonymous
>>
>> "xfile" <cou-cou@.remove.nospam.com> wrote in message
>> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>> Hi,
>> When I used SQL Server Management Studio to open several tables (SQL
>> 2005), some records are not listed in the order - for example, listed by
>> orderid, customerid, or so on.
>> Is there a way that I can have them listed in order?
>> Many thanks in advance.
>>
>|||Hi,
Thanks again for all of your kind explanations.
I did find the pane-criteria, and tried a few times and happy with the
results even I have to add all columns into criteria.
I am totally unfamiliar with database and accustomed to Access simple
graphic interface. We started using SQL 2000 last year (from hosting
company) and all queries are built-in with applications, and we recently
upgraded to a new version of the application and also moved to SQL 2005.
SQL 2005 is fast!!!
The purpose is to open some tables and delete testing data.
Again, many thanks for all of your kind explanations.
"KL" <noname@.nowhere.com> wrote in message
news:OWDzCvexGHA.980@.TK2MSFTNGP04.phx.gbl...
>
> You can right click on the column and select Pane > Criteria to sort the
> result.
> KL.
>
> "xfile" <cou-cou@.remove.nospam.com> skrev i meddelandet
> news:eL4rtqYxGHA.5056@.TK2MSFTNGP06.phx.gbl...
>> Hi,
>> When I used SQL Server Management Studio to open several tables (SQL
>> 2005), some records are not listed in the order - for example, listed by
>> orderid, customerid, or so on.
>> Is there a way that I can have them listed in order?
>> Many thanks in advance.
>

Monday, February 20, 2012

Record set update

Hi

I am new to visual studio and I am attempting to edit records held in mysql, the code below runs and throws no errors "strAdd" is underlined and says that it is used before it has been given a value! But If I debug.print(strAdd) I get the expected string returned. What do I need to do to get the updated records saved?

' code

Dim cn As ADODB.Connection

Dim rs As ADODB.Recordset

Dim StrAdd as string

cn = New ADODB.Connection

cn.ConnectionString = "Provider=SQLNCLI;" _

& "Server=(local);" _

& "Database=customerlink;" _

& "Integrated Security=SSPI;" _

& "DataTypeCompatibility=80;" _

& "MARS Connection=True;"

Dim mySQL As String

mySQL = "SELECT*" & _

" FROM tblvsol" & _

" Where RevStatus = " & 0 & _

" And GeoCodeStatus = " & 1

cn.Open()

rs = New ADODB.Recordset

With rs

.ActiveConnection = cn

.CursorLocation = ADODB.CursorLocationEnum.adUseClient

.CursorType = ADODB.CursorTypeEnum.adOpenDynamic

.LockType = ADODB.LockTypeEnum.adLockBatchOptimistic

.Open(mySQL)

End With

Do While Not rs.EOF

Code here finds the value for the string variable ‘atrAdd’

strAdd = New Value

If Not strAdd Is Nothing Then

rs.Fields("location").Value = strAdd

rs.Fields("RevStatus").Value = 1

rs.Update()

else

end if

loop

Regards

Joe

Hi Experts

Have I posted in the wrong forum?

Regards

|||Can you add some code on how you're assigning new value to strAdd?|||Actually, yes you posted in the wrong forum, but nevertheless we will help you. Do you enter the Is Nothing part and the appropiate update or does the execution never touch this portion of the code ? Are you able to send a reproducable class to us ? as from the information you posted the code should be Ok. Did you start the profiler to see wheter the command is executed against the database or could you make sure through debugging that it never enters portion of the code ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Hi Experts

Thanks for your response, The variable StrAdd Is a street address which is returned from a mappoint recordset:

StrAdd = objResults.Item(1).Location.StreetAddress.Value

This is returned as a string.

The update portion of the code is only entered If a string value is returned from the mappoint recordset.

Regards,

joe

|||Ok, this is now a bit clearer to me, but did you check the value during debugging time or did you run the profiler ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Hi Jens K. Suessmeyer.

Thanks for your response, I had checked the value during debugging. I have had a reply posted on another forum which has provided me with the answer, I appreciate your efforts on my behalf and would not like to waste your time. I have reproduced the reply below, again..

Thank you,

Joe

instead of opening the recordset like so:

rcdSet.Open strSQL, ADO, adOpenForwardOnly, adLockReadOnly, -1

Use this method:

rcdSet.Open strSQL, ADO, adOpenDynamic, adLockBatchOptimistic, -1

Now, after looping through your recordset and changing your values, call:

rcdSet.UpdateBatch

|||Or as an alternative if you want to use Update method and not UpdateBatch - then you can use adLockOptimistic for lock type.