Hi,
One of my app servers has filled the c:\ drive with transactions log's.
Someone moved the log's to another disk, SQL now reports the database as
being suspect. We moved the log's back, it still reports the db as suspect?
Any help would be greatly appreciated
Rich
Hi,
take a look here:
http://www.karaszi.com/SQLServer/inf...suspect_db.asp
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||reset should resolve the problem (order in sequences, try the next step
if the first one doesn't work).
1) restart the MSSQL services (starts the auto recovery)
2) detach and re-attach the database
3) restore the latest database backup
Mel
2012年3月25日星期日
Disk Full of transactions log's
Hi,
One of my app servers has filled the c:\ drive with transactions log's.
Someone moved the log's to another disk, SQL now reports the database as
being suspect. We moved the log's back, it still reports the db as suspect?
Any help would be greatly appreciated
RichHi,
take a look here:
http://www.karaszi.com/SQLServer/info_corrupt_suspect_db.asp
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--|||reset should resolve the problem (order in sequences, try the next step
if the first one doesn't work).
1) restart the MSSQL services (starts the auto recovery)
2) detach and re-attach the database
3) restore the latest database backup
Mel
One of my app servers has filled the c:\ drive with transactions log's.
Someone moved the log's to another disk, SQL now reports the database as
being suspect. We moved the log's back, it still reports the db as suspect?
Any help would be greatly appreciated
RichHi,
take a look here:
http://www.karaszi.com/SQLServer/info_corrupt_suspect_db.asp
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--|||reset should resolve the problem (order in sequences, try the next step
if the first one doesn't work).
1) restart the MSSQL services (starts the auto recovery)
2) detach and re-attach the database
3) restore the latest database backup
Mel
Disk Full of transactions log's
Hi,
One of my app servers has filled the c:\ drive with transactions log's.
Someone moved the log's to another disk, SQL now reports the database as
being suspect. We moved the log's back, it still reports the db as suspect?
Any help would be greatly appreciated
RichHi,
take a look here:
http://www.karaszi.com/SQLServer/in..._suspect_db.asp
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--|||reset should resolve the problem (order in sequences, try the next step
if the first one doesn't work).
1) restart the MSSQL services (starts the auto recovery)
2) detach and re-attach the database
3) restore the latest database backup
Mel
One of my app servers has filled the c:\ drive with transactions log's.
Someone moved the log's to another disk, SQL now reports the database as
being suspect. We moved the log's back, it still reports the db as suspect?
Any help would be greatly appreciated
RichHi,
take a look here:
http://www.karaszi.com/SQLServer/in..._suspect_db.asp
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--|||reset should resolve the problem (order in sequences, try the next step
if the first one doesn't work).
1) restart the MSSQL services (starts the auto recovery)
2) detach and re-attach the database
3) restore the latest database backup
Mel
2012年3月19日星期一
Disconnected app with sql server compact
Hi
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
Regards
The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
Regards
The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
Disconnected app with sql server compact
Hi
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
Regards
If you want to use views and stored procedures, then SQL Server Compact is
not an option. However, you can use SQL Server Express, which supports
procedural T-SQL.
HTH,
Plamen Ratchev
http://www.SQLStudio.com
|||The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
Regards
If you want to use views and stored procedures, then SQL Server Compact is
not an option. However, you can use SQL Server Express, which supports
procedural T-SQL.
HTH,
Plamen Ratchev
http://www.SQLStudio.com
|||The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
Disconnected app with sql server compact
Hi
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
RegardsIf you want to use views and stored procedures, then SQL Server Compact is
not an option. However, you can use SQL Server Express, which supports
procedural T-SQL.
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
RegardsIf you want to use views and stored procedures, then SQL Server Compact is
not an option. However, you can use SQL Server Express, which supports
procedural T-SQL.
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
Disconnected app with sql server compact
Hi
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
RegardsIf you want to use views and stored procedures, then SQL Server Compact is
not an option. However, you can use SQL Server Express, which supports
procedural T-SQL.
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
I am developing an app in vb.net 2008 with sql server 2000 backend. I also
need disconnected version of the app for laptop users who would connect off
and on with LAN and thereby with the company sql server 2000. I am wondering
if I can use sql server compact 3.5 for local caching when laptops are
disconnected. My question is; how would my app use views and stored
procedures in disconnected mode as sql server compact does not support
either of these. Any help to clarify this would be appreciated.
Thanks
RegardsIf you want to use views and stored procedures, then SQL Server Compact is
not an option. However, you can use SQL Server Express, which supports
procedural T-SQL.
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||The local Compact Edition database could be used for data caching. You could
write your own managed code to access it but as you found, there is no
support for SPs or Views. Your only other alternative would be to use the
Express edition on the client system which does support SPs and Views. In
either case you would want to use one of the various synchronization
paradigms to keep the two databases in sync.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>|||Like Bill V said, the main point is that you'd need to synchronize your
data. since there aren't views or stored procs, there's no way to do it
directly. You can create a backgroun thread or other mechanism to determine
when you are connected to the network, and when you are, flip a flag and
then use your DALC to talk directly to the big sql server.
You can mimick views (although not anything close to the real thing) by
filling a datatable with a query that corresponds to what the view was.
Although I'm not going to even touch the stored proc vs dynamic sql debate,
I can say that much of the benefit of using stored procs diminishes when
you're using a local db like Compact Edition in this manner.
You can also just bypass CE altogether. Pull down the data from sql server
into a dataset that contains everything you need to work with, interact with
that local data, buy some persistence by saving it to XML using writexml and
then when you're connected again, you can just run your Update() on the full
sql server. There's a ton of tradeoffs here so don't take this is a
recommendation, rather it's just a statement saying if you only need a
local cache of data, you don't necessarily need Compact Edition at all.
If it were mine though, i'd do as Mr Vaughn says and use it w/
synchronization.
"John" <John@.nospam.infovis.co.uk> wrote in message
news:O5clkypMIHA.4480@.TK2MSFTNGP06.phx.gbl...
> Hi
> I am developing an app in vb.net 2008 with sql server 2000 backend. I also
> need disconnected version of the app for laptop users who would connect
> off and on with LAN and thereby with the company sql server 2000. I am
> wondering if I can use sql server compact 3.5 for local caching when
> laptops are disconnected. My question is; how would my app use views and
> stored procedures in disconnected mode as sql server compact does not
> support either of these. Any help to clarify this would be appreciated.
> Thanks
> Regards
>
2012年2月25日星期六
Disabling firewall only way to connect, was working
Well, I discovered my once-working web app is failing to connect to SQL Server.
I had the windows Firewall running and working with a non-standard port and
responding to subnet only.
Windows update is configure to auto install. At some point in late December
the machine was rebooted. Coincidentally, after that, the only way to make
the connection work was to completely disable the windows firewall. Not an
option.
Windows 2003 - With latest critical updates from MS
SQL Server 2005 SP1
SQL and IIS are on separate machines.
TCP is the only enabled protocol for SQL
VS.Net 2005, using System.Data.SqlClient
Connection string is: Data Source=nnn.nnn.nnn.nnn,9919;Initial
Catalog=dbname;User Id=yourname;Password=yourpassword
I have tried moving SQL back to PORT 1433, and added sqlsvrer.exe as an
acceptable application, but it did not work.
MS SQL Server Management Studio does not connect with firewall enabled.
I was able to connect our production web application to our development
database. I was not able to connect our development server's version to the
production database. Both production and development have the same firewall
settings and MS updates. So, I am guessing there is something very wrong with
our production SQL?
Not sure if this is related, but I have noticed a 10 or so second lag
between Remote Desktop access initiation and an answer. On our
web servers the answer is near instant. Once in, it works fine. We are on
a very large network.
Any ideas? Am I missing a port?
Nevermind. Fixed.
Removed and recreated firewall setting for SQL. Also, the default gateway
was not the same between machines. These had not been modified in over 6
months.
Seems to work now.
"Devin" wrote:
> Well, I discovered my once-working web app is failing to connect to SQL Server.
> I had the windows Firewall running and working with a non-standard port and
> responding to subnet only.
> Windows update is configure to auto install. At some point in late December
> the machine was rebooted. Coincidentally, after that, the only way to make
> the connection work was to completely disable the windows firewall. Not an
> option.
> Windows 2003 - With latest critical updates from MS
> SQL Server 2005 SP1
> SQL and IIS are on separate machines.
> TCP is the only enabled protocol for SQL
> VS.Net 2005, using System.Data.SqlClient
> Connection string is: Data Source=nnn.nnn.nnn.nnn,9919;Initial
> Catalog=dbname;User Id=yourname;Password=yourpassword
> I have tried moving SQL back to PORT 1433, and added sqlsvrer.exe as an
> acceptable application, but it did not work.
> MS SQL Server Management Studio does not connect with firewall enabled.
> I was able to connect our production web application to our development
> database. I was not able to connect our development server's version to the
> production database. Both production and development have the same firewall
> settings and MS updates. So, I am guessing there is something very wrong with
> our production SQL?
> Not sure if this is related, but I have noticed a 10 or so second lag
> between Remote Desktop access initiation and an answer. On our
> web servers the answer is near instant. Once in, it works fine. We are on
> a very large network.
> Any ideas? Am I missing a port?
>
I had the windows Firewall running and working with a non-standard port and
responding to subnet only.
Windows update is configure to auto install. At some point in late December
the machine was rebooted. Coincidentally, after that, the only way to make
the connection work was to completely disable the windows firewall. Not an
option.
Windows 2003 - With latest critical updates from MS
SQL Server 2005 SP1
SQL and IIS are on separate machines.
TCP is the only enabled protocol for SQL
VS.Net 2005, using System.Data.SqlClient
Connection string is: Data Source=nnn.nnn.nnn.nnn,9919;Initial
Catalog=dbname;User Id=yourname;Password=yourpassword
I have tried moving SQL back to PORT 1433, and added sqlsvrer.exe as an
acceptable application, but it did not work.
MS SQL Server Management Studio does not connect with firewall enabled.
I was able to connect our production web application to our development
database. I was not able to connect our development server's version to the
production database. Both production and development have the same firewall
settings and MS updates. So, I am guessing there is something very wrong with
our production SQL?
Not sure if this is related, but I have noticed a 10 or so second lag
between Remote Desktop access initiation and an answer. On our
web servers the answer is near instant. Once in, it works fine. We are on
a very large network.
Any ideas? Am I missing a port?
Nevermind. Fixed.
Removed and recreated firewall setting for SQL. Also, the default gateway
was not the same between machines. These had not been modified in over 6
months.
Seems to work now.
"Devin" wrote:
> Well, I discovered my once-working web app is failing to connect to SQL Server.
> I had the windows Firewall running and working with a non-standard port and
> responding to subnet only.
> Windows update is configure to auto install. At some point in late December
> the machine was rebooted. Coincidentally, after that, the only way to make
> the connection work was to completely disable the windows firewall. Not an
> option.
> Windows 2003 - With latest critical updates from MS
> SQL Server 2005 SP1
> SQL and IIS are on separate machines.
> TCP is the only enabled protocol for SQL
> VS.Net 2005, using System.Data.SqlClient
> Connection string is: Data Source=nnn.nnn.nnn.nnn,9919;Initial
> Catalog=dbname;User Id=yourname;Password=yourpassword
> I have tried moving SQL back to PORT 1433, and added sqlsvrer.exe as an
> acceptable application, but it did not work.
> MS SQL Server Management Studio does not connect with firewall enabled.
> I was able to connect our production web application to our development
> database. I was not able to connect our development server's version to the
> production database. Both production and development have the same firewall
> settings and MS updates. So, I am guessing there is something very wrong with
> our production SQL?
> Not sure if this is related, but I have noticed a 10 or so second lag
> between Remote Desktop access initiation and an answer. On our
> web servers the answer is near instant. Once in, it works fine. We are on
> a very large network.
> Any ideas? Am I missing a port?
>
Disabling firewall only way to connect, was working
Well, I discovered my once-working web app is failing to connect to SQL Serv
er.
I had the windows Firewall running and working with a non-standard port and
responding to subnet only.
Windows update is configure to auto install. At some point in late December
the machine was rebooted. Coincidentally, after that, the only way to make
the connection work was to completely disable the windows firewall. Not an
option.
Windows 2003 - With latest critical updates from MS
SQL Server 2005 SP1
SQL and IIS are on separate machines.
TCP is the only enabled protocol for SQL
VS.Net 2005, using System.Data.SqlClient
Connection string is: Data Source=nnn.nnn.nnn.nnn,9919;Initial
Catalog=dbname;User Id=yourname;Password=yourpassword
I have tried moving SQL back to PORT 1433, and added sqlsvrer.exe as an
acceptable application, but it did not work.
MS SQL Server Management Studio does not connect with firewall enabled.
I was able to connect our production web application to our development
database. I was not able to connect our development server's version to the
production database. Both production and development have the same firewall
settings and MS updates. So, I am guessing there is something very wrong wit
h
our production SQL?
Not sure if this is related, but I have noticed a 10 or so second lag
between Remote Desktop access initiation and an answer. On our
web servers the answer is near instant. Once in, it works fine. We are on
a very large network.
Any ideas? Am I missing a port?Nevermind. Fixed.
Removed and recreated firewall setting for SQL. Also, the default gateway
was not the same between machines. These had not been modified in over 6
months.
Seems to work now.
"Devin" wrote:
> Well, I discovered my once-working web app is failing to connect to SQL Se
rver.
> I had the windows Firewall running and working with a non-standard port an
d
> responding to subnet only.
> Windows update is configure to auto install. At some point in late Decembe
r
> the machine was rebooted. Coincidentally, after that, the only way to make
> the connection work was to completely disable the windows firewall. Not a
n
> option.
> Windows 2003 - With latest critical updates from MS
> SQL Server 2005 SP1
> SQL and IIS are on separate machines.
> TCP is the only enabled protocol for SQL
> VS.Net 2005, using System.Data.SqlClient
> Connection string is: Data Source=nnn.nnn.nnn.nnn,9919;Initial
> Catalog=dbname;User Id=yourname;Password=yourpassword
> I have tried moving SQL back to PORT 1433, and added sqlsvrer.exe as an
> acceptable application, but it did not work.
> MS SQL Server Management Studio does not connect with firewall enabled.
> I was able to connect our production web application to our development
> database. I was not able to connect our development server's version to t
he
> production database. Both production and development have the same firewa
ll
> settings and MS updates. So, I am guessing there is something very wrong w
ith
> our production SQL?
> Not sure if this is related, but I have noticed a 10 or so second lag
> between Remote Desktop access initiation and an answer. On our
> web servers the answer is near instant. Once in, it works fine. We are o
n
> a very large network.
> Any ideas? Am I missing a port?
>
er.
I had the windows Firewall running and working with a non-standard port and
responding to subnet only.
Windows update is configure to auto install. At some point in late December
the machine was rebooted. Coincidentally, after that, the only way to make
the connection work was to completely disable the windows firewall. Not an
option.
Windows 2003 - With latest critical updates from MS
SQL Server 2005 SP1
SQL and IIS are on separate machines.
TCP is the only enabled protocol for SQL
VS.Net 2005, using System.Data.SqlClient
Connection string is: Data Source=nnn.nnn.nnn.nnn,9919;Initial
Catalog=dbname;User Id=yourname;Password=yourpassword
I have tried moving SQL back to PORT 1433, and added sqlsvrer.exe as an
acceptable application, but it did not work.
MS SQL Server Management Studio does not connect with firewall enabled.
I was able to connect our production web application to our development
database. I was not able to connect our development server's version to the
production database. Both production and development have the same firewall
settings and MS updates. So, I am guessing there is something very wrong wit
h
our production SQL?
Not sure if this is related, but I have noticed a 10 or so second lag
between Remote Desktop access initiation and an answer. On our
web servers the answer is near instant. Once in, it works fine. We are on
a very large network.
Any ideas? Am I missing a port?Nevermind. Fixed.
Removed and recreated firewall setting for SQL. Also, the default gateway
was not the same between machines. These had not been modified in over 6
months.
Seems to work now.
"Devin" wrote:
> Well, I discovered my once-working web app is failing to connect to SQL Se
rver.
> I had the windows Firewall running and working with a non-standard port an
d
> responding to subnet only.
> Windows update is configure to auto install. At some point in late Decembe
r
> the machine was rebooted. Coincidentally, after that, the only way to make
> the connection work was to completely disable the windows firewall. Not a
n
> option.
> Windows 2003 - With latest critical updates from MS
> SQL Server 2005 SP1
> SQL and IIS are on separate machines.
> TCP is the only enabled protocol for SQL
> VS.Net 2005, using System.Data.SqlClient
> Connection string is: Data Source=nnn.nnn.nnn.nnn,9919;Initial
> Catalog=dbname;User Id=yourname;Password=yourpassword
> I have tried moving SQL back to PORT 1433, and added sqlsvrer.exe as an
> acceptable application, but it did not work.
> MS SQL Server Management Studio does not connect with firewall enabled.
> I was able to connect our production web application to our development
> database. I was not able to connect our development server's version to t
he
> production database. Both production and development have the same firewa
ll
> settings and MS updates. So, I am guessing there is something very wrong w
ith
> our production SQL?
> Not sure if this is related, but I have noticed a 10 or so second lag
> between Remote Desktop access initiation and an answer. On our
> web servers the answer is near instant. Once in, it works fine. We are o
n
> a very large network.
> Any ideas? Am I missing a port?
>
2012年2月19日星期日
Disable Server Error Messages to Client App (VB)
Hi people!
Can anyone help me with this one? Using SQL Server 2000 and VB5,
calling a stored procedure from VB code. When a message occurs like:
Server: Msg 515, Level 16, State 2, Procedure Ve_KarticeIsplate, Line
235
Cannot insert the value NULL into column 'konto', table
'ibis.dbo.promkred'; column does not allow nulls. INSERT fails.
The statement has been terminated.
VB freaks out, looses the connection to server and stops the execution.
I want to be either be able to disable this message or to ignore it
from client app (using ADO for connection)...
(Simply to ignore the error)Hi VesnaSA,
Here are two excellent articles on error handling in SQL server:
http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
A lot of reading but it's worth it.
"VesnaSA" <VesnaVujovicSA@.gmail.com> wrote in message
news:1132235726.691296.264240@.g14g2000cwa.googlegroups.com...
> Hi people!
> Can anyone help me with this one? Using SQL Server 2000 and VB5,
> calling a stored procedure from VB code. When a message occurs like:
> Server: Msg 515, Level 16, State 2, Procedure Ve_KarticeIsplate, Line
> 235
> Cannot insert the value NULL into column 'konto', table
> 'ibis.dbo.promkred'; column does not allow nulls. INSERT fails.
> The statement has been terminated.
> VB freaks out, looses the connection to server and stops the execution.
> I want to be either be able to disable this message or to ignore it
> from client app (using ADO for connection)...
> (Simply to ignore the error)
>|||> Cannot insert the value NULL into column 'konto', table
> 'ibis.dbo.promkred'; column does not allow nulls. INSERT fails.
> The statement has been terminated.
> VB freaks out, looses the connection to server and stops the execution.
> I want to be either be able to disable this message or to ignore it
> from client app (using ADO for connection)...
> (Simply to ignore the error)
>
it would be better though not to pass NULL value to this column? or drop the
constraint from database, though i assume that having nulls in konto column
might be somewhat confusing for people working with account related
application
peter|||Thanx but i handle those transactions with errors in another way, by
placing them in another table,
the point is not to prevent it but to disable the message so that the
procedure can go on for the correct
ones and just skip the ones with errors... To prevent VB to loose the
connection when error happens...
But thanx anyway...|||Thanx Reymond, I'll dig into it, it seams that there is no way to
prevent server from sending the message, thw question is now if the
recordset in ADO can be adjusted so it doesn't report the message?|||I'm not a VB programmer but maybe this will help:
(this is script but you can probably adapt it to VB)
ON ERROR RESUME NEXT
--execute your stored procedure Ve_KarticeIsplate here
If you wish, you can view the errors:
If objConn.errors.count > 0 then
Response.write(objConn.errors.count) & " = " &
objConn.errors(0).description
For counter= 0 to objConn.errors.count
Response.write(objConn.errors(counter).number)
Response.write(objConn.errors(counter).description)
Next
end if
If you're still having problems, post in one of the VB newsgroups.
"VesnaSA" <VesnaVujovicSA@.gmail.com> wrote in message
news:1132238362.365549.85690@.z14g2000cwz.googlegroups.com...
> Thanx Reymond, I'll dig into it, it seams that there is no way to
> prevent server from sending the message, thw question is now if the
> recordset in ADO can be adjusted so it doesn't report the message?
>|||shouldn't you do it in the stored procedure then? using db to handle and
send errors might be expensive, and ADO is not best on handling errors.
also, I assume that account number shouldn't be empty and this is a business
rule, so why don't you check it before you call db? this would save you the
problem. exceptions should not be the way you control flow of your program.
Peter
"VesnaSA" <VesnaVujovicSA@.gmail.com> wrote in message
news:1132237902.217152.65360@.g14g2000cwa.googlegroups.com...
> Thanx but i handle those transactions with errors in another way, by
> placing them in another table,
> the point is not to prevent it but to disable the message so that the
> procedure can go on for the correct
> ones and just skip the ones with errors... To prevent VB to loose the
> connection when error happens...
> But thanx anyway...
>|||"Rogas69" <rogas69@.no_spamers.o2.ie> wrote in message
news:%23GEb9u46FHA.2716@.TK2MSFTNGP11.phx.gbl...
> shouldn't you do it in the stored procedure then? using db to handle and
> send errors might be expensive, and ADO is not best on handling errors.
> also, I assume that account number shouldn't be empty and this is a
> business rule, so why don't you check it before you call db? this would
> save you the problem. exceptions should not be the way you control flow of
> your program.
> Peter
I agree with you on this one.
Error handling has to be done in the database.
The parameters must be validated client side.
But (I'm sure that you saw the BUT coming) error handling also has to be
done in VB.
Imagine these cases:
-the connexion to the database is lost
-someone changed something in the database
-some unforseen error occors in the SP|||First, resolve the bug in the stored procedure which is trying to insert a
NULL into a non-nullable column.
There are techniques for implementing error handling in T-SQL, but this is
only useful for basic things like rolling back transactions and process
flow. The last line of defense is error handling at the application level,
and based on your description of the "VB freaks out", it sounds like perhaps
there no module or function level handling in the application, and the error
is being escalated up the call stack until becomes unrecoverable.
Handling Errors in Visual Basic
Error Handling Hierarchy
http://msdn.microsoft.com/library/d...nghierarchy.asp
Handling Errors and Messages in ADO
http://msdn.microsoft.com/library/d...
9pr.asp
http://msdn.microsoft.com/library/d...rorhandling.asp
"VesnaSA" <VesnaVujovicSA@.gmail.com> wrote in message
news:1132235726.691296.264240@.g14g2000cwa.googlegroups.com...
> Hi people!
> Can anyone help me with this one? Using SQL Server 2000 and VB5,
> calling a stored procedure from VB code. When a message occurs like:
> Server: Msg 515, Level 16, State 2, Procedure Ve_KarticeIsplate, Line
> 235
> Cannot insert the value NULL into column 'konto', table
> 'ibis.dbo.promkred'; column does not allow nulls. INSERT fails.
> The statement has been terminated.
> VB freaks out, looses the connection to server and stops the execution.
> I want to be either be able to disable this message or to ignore it
> from client app (using ADO for connection)...
> (Simply to ignore the error)
>|||True, it is important to implement T-SQL error handling so that the
transaction is rolled back, but any advanced error handling like retry logic
or logging errors is best implemented at the application level.
"Raymond D'Anjou" <rdanjou@.canatradeNOSPAM.com> wrote in message
news:e2XAz%2346FHA.3660@.TK2MSFTNGP09.phx.gbl...
> "Rogas69" <rogas69@.no_spamers.o2.ie> wrote in message
> news:%23GEb9u46FHA.2716@.TK2MSFTNGP11.phx.gbl...
> I agree with you on this one.
> Error handling has to be done in the database.
> The parameters must be validated client side.
> But (I'm sure that you saw the BUT coming) error handling also has to be
> done in VB.
> Imagine these cases:
> -the connexion to the database is lost
> -someone changed something in the database
> -some unforseen error occors in the SP
>
Can anyone help me with this one? Using SQL Server 2000 and VB5,
calling a stored procedure from VB code. When a message occurs like:
Server: Msg 515, Level 16, State 2, Procedure Ve_KarticeIsplate, Line
235
Cannot insert the value NULL into column 'konto', table
'ibis.dbo.promkred'; column does not allow nulls. INSERT fails.
The statement has been terminated.
VB freaks out, looses the connection to server and stops the execution.
I want to be either be able to disable this message or to ignore it
from client app (using ADO for connection)...
(Simply to ignore the error)Hi VesnaSA,
Here are two excellent articles on error handling in SQL server:
http://www.sommarskog.se/error-handling-I.html
http://www.sommarskog.se/error-handling-II.html
A lot of reading but it's worth it.
"VesnaSA" <VesnaVujovicSA@.gmail.com> wrote in message
news:1132235726.691296.264240@.g14g2000cwa.googlegroups.com...
> Hi people!
> Can anyone help me with this one? Using SQL Server 2000 and VB5,
> calling a stored procedure from VB code. When a message occurs like:
> Server: Msg 515, Level 16, State 2, Procedure Ve_KarticeIsplate, Line
> 235
> Cannot insert the value NULL into column 'konto', table
> 'ibis.dbo.promkred'; column does not allow nulls. INSERT fails.
> The statement has been terminated.
> VB freaks out, looses the connection to server and stops the execution.
> I want to be either be able to disable this message or to ignore it
> from client app (using ADO for connection)...
> (Simply to ignore the error)
>|||> Cannot insert the value NULL into column 'konto', table
> 'ibis.dbo.promkred'; column does not allow nulls. INSERT fails.
> The statement has been terminated.
> VB freaks out, looses the connection to server and stops the execution.
> I want to be either be able to disable this message or to ignore it
> from client app (using ADO for connection)...
> (Simply to ignore the error)
>
it would be better though not to pass NULL value to this column? or drop the
constraint from database, though i assume that having nulls in konto column
might be somewhat confusing for people working with account related
application
peter|||Thanx but i handle those transactions with errors in another way, by
placing them in another table,
the point is not to prevent it but to disable the message so that the
procedure can go on for the correct
ones and just skip the ones with errors... To prevent VB to loose the
connection when error happens...
But thanx anyway...|||Thanx Reymond, I'll dig into it, it seams that there is no way to
prevent server from sending the message, thw question is now if the
recordset in ADO can be adjusted so it doesn't report the message?|||I'm not a VB programmer but maybe this will help:
(this is script but you can probably adapt it to VB)
ON ERROR RESUME NEXT
--execute your stored procedure Ve_KarticeIsplate here
If you wish, you can view the errors:
If objConn.errors.count > 0 then
Response.write(objConn.errors.count) & " = " &
objConn.errors(0).description
For counter= 0 to objConn.errors.count
Response.write(objConn.errors(counter).number)
Response.write(objConn.errors(counter).description)
Next
end if
If you're still having problems, post in one of the VB newsgroups.
"VesnaSA" <VesnaVujovicSA@.gmail.com> wrote in message
news:1132238362.365549.85690@.z14g2000cwz.googlegroups.com...
> Thanx Reymond, I'll dig into it, it seams that there is no way to
> prevent server from sending the message, thw question is now if the
> recordset in ADO can be adjusted so it doesn't report the message?
>|||shouldn't you do it in the stored procedure then? using db to handle and
send errors might be expensive, and ADO is not best on handling errors.
also, I assume that account number shouldn't be empty and this is a business
rule, so why don't you check it before you call db? this would save you the
problem. exceptions should not be the way you control flow of your program.
Peter
"VesnaSA" <VesnaVujovicSA@.gmail.com> wrote in message
news:1132237902.217152.65360@.g14g2000cwa.googlegroups.com...
> Thanx but i handle those transactions with errors in another way, by
> placing them in another table,
> the point is not to prevent it but to disable the message so that the
> procedure can go on for the correct
> ones and just skip the ones with errors... To prevent VB to loose the
> connection when error happens...
> But thanx anyway...
>|||"Rogas69" <rogas69@.no_spamers.o2.ie> wrote in message
news:%23GEb9u46FHA.2716@.TK2MSFTNGP11.phx.gbl...
> shouldn't you do it in the stored procedure then? using db to handle and
> send errors might be expensive, and ADO is not best on handling errors.
> also, I assume that account number shouldn't be empty and this is a
> business rule, so why don't you check it before you call db? this would
> save you the problem. exceptions should not be the way you control flow of
> your program.
> Peter
I agree with you on this one.
Error handling has to be done in the database.
The parameters must be validated client side.
But (I'm sure that you saw the BUT coming) error handling also has to be
done in VB.
Imagine these cases:
-the connexion to the database is lost
-someone changed something in the database
-some unforseen error occors in the SP|||First, resolve the bug in the stored procedure which is trying to insert a
NULL into a non-nullable column.
There are techniques for implementing error handling in T-SQL, but this is
only useful for basic things like rolling back transactions and process
flow. The last line of defense is error handling at the application level,
and based on your description of the "VB freaks out", it sounds like perhaps
there no module or function level handling in the application, and the error
is being escalated up the call stack until becomes unrecoverable.
Handling Errors in Visual Basic
Error Handling Hierarchy
http://msdn.microsoft.com/library/d...nghierarchy.asp
Handling Errors and Messages in ADO
http://msdn.microsoft.com/library/d...
9pr.asp
http://msdn.microsoft.com/library/d...rorhandling.asp
"VesnaSA" <VesnaVujovicSA@.gmail.com> wrote in message
news:1132235726.691296.264240@.g14g2000cwa.googlegroups.com...
> Hi people!
> Can anyone help me with this one? Using SQL Server 2000 and VB5,
> calling a stored procedure from VB code. When a message occurs like:
> Server: Msg 515, Level 16, State 2, Procedure Ve_KarticeIsplate, Line
> 235
> Cannot insert the value NULL into column 'konto', table
> 'ibis.dbo.promkred'; column does not allow nulls. INSERT fails.
> The statement has been terminated.
> VB freaks out, looses the connection to server and stops the execution.
> I want to be either be able to disable this message or to ignore it
> from client app (using ADO for connection)...
> (Simply to ignore the error)
>|||True, it is important to implement T-SQL error handling so that the
transaction is rolled back, but any advanced error handling like retry logic
or logging errors is best implemented at the application level.
"Raymond D'Anjou" <rdanjou@.canatradeNOSPAM.com> wrote in message
news:e2XAz%2346FHA.3660@.TK2MSFTNGP09.phx.gbl...
> "Rogas69" <rogas69@.no_spamers.o2.ie> wrote in message
> news:%23GEb9u46FHA.2716@.TK2MSFTNGP11.phx.gbl...
> I agree with you on this one.
> Error handling has to be done in the database.
> The parameters must be validated client side.
> But (I'm sure that you saw the BUT coming) error handling also has to be
> done in VB.
> Imagine these cases:
> -the connexion to the database is lost
> -someone changed something in the database
> -some unforseen error occors in the SP
>
订阅:
博文 (Atom)