Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Friday, March 30, 2012

problem in inserting date in sql server 7 through insert query

hello myself avinash
i am developing on application having vb 6 as front end and sql server 7
as back end.
when i use insert query to insert data in table then the date value of
that query is going as 01/01/1900
my query is as follows

StrSql = "Insert Into
SalesVoucher(TransactionID,VoucherNo,VoucherDate,D ebitTo,CreditTo,TotalAmt,Discount,ModAmt,ModWt,Oth er,Othertype,TaxPerc,TaxAmt,NetAmt,Advance,Narrati on,Haste)"
StrSql = StrSql & " Values(" & txtTransactionID.text & "," &
txtChallanno.text & ",'" & Format(txtChallanDate.Value, "dd/mm/yyyy") &
"'," & AccCode & ",'" & IIf((Category = "Gold"), 36, 38) & "',"
StrSql = StrSql & vsAmountDesc.ValueMatrix(RowAmountArr(0),
2)
& "," & vsAmountDesc.ValueMatrix(RowAmountArr(2), 2) & "," &
val(txtModTotal.caption) & "," & val(TxtModWt.caption) & ","
StrSql = StrSql & vsAmountDesc.ValueMatrix(RowAmountArr(1),
2)
& ",'" & vsAmountDesc.TextMatrix(RowAmountArr(1), 1) & "','" &
vsAmountDesc.TextMatrix(RowAmountArr(4), 1) & "'," &
vsAmountDesc.ValueMatrix(RowAmountArr(4), 2) & ","
StrSql = StrSql & vsAmountDesc.ValueMatrix(RowAmountArr(3),
2)
+ val(txtModTotal.caption) & "," & val(txtAdvance.text) & ",'-'," &
IIf(Trim(txtHaste.text) <> "", RetriveAccountCode(Trim(txtHaste.text)),
0)
& ")"

and its output is

Insert Into
SalesVoucher(TransactionID,VoucherNo,VoucherDate,D ebitTo,CreditTo,TotalAmt,Discount,ModAmt,ModWt,Oth er,Othertype,TaxPerc,TaxAmt,NetAmt,Advance,Narrati on,Haste)
Values(18,1831,'07/04/2004',150,'36',11000,0,0,0,-10,'','1.00',109.9,11100,0,'-',0)

in above query though i used cdate to voucherdate value still it save in
database as 01/01/1900 though here it shows right date
plz help me its a very big issue for me & i really just fed of this
problemYou might try running a Profiler trace to capture the actual statement
executed by SQL Server and check for any triggers that might change the
value. Note that SQL Server will interpret an empty string as 1900-01-01.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"avinash" <pawar_avinash@.rediffmail.com> wrote in message
news:9c11bb7aacaeeddcf230738468fd3b72@.localhost.ta lkaboutdatabases.com...
> hello myself avinash
> i am developing on application having vb 6 as front end and sql server 7
> as back end.
> when i use insert query to insert data in table then the date value of
> that query is going as 01/01/1900
> my query is as follows
> StrSql = "Insert Into
> SalesVoucher(TransactionID,VoucherNo,VoucherDate,D ebitTo,CreditTo,TotalAmt,Discount,ModAmt,ModWt,Oth er,Othertype,TaxPerc,TaxAmt,NetAmt,Advance,Narrati on,Haste)"
> StrSql = StrSql & " Values(" & txtTransactionID.text & "," &
> txtChallanno.text & ",'" & Format(txtChallanDate.Value, "dd/mm/yyyy") &
> "'," & AccCode & ",'" & IIf((Category = "Gold"), 36, 38) & "',"
> StrSql = StrSql & vsAmountDesc.ValueMatrix(RowAmountArr(0),
> 2)
> & "," & vsAmountDesc.ValueMatrix(RowAmountArr(2), 2) & "," &
> val(txtModTotal.caption) & "," & val(TxtModWt.caption) & ","
> StrSql = StrSql & vsAmountDesc.ValueMatrix(RowAmountArr(1),
> 2)
> & ",'" & vsAmountDesc.TextMatrix(RowAmountArr(1), 1) & "','" &
> vsAmountDesc.TextMatrix(RowAmountArr(4), 1) & "'," &
> vsAmountDesc.ValueMatrix(RowAmountArr(4), 2) & ","
> StrSql = StrSql & vsAmountDesc.ValueMatrix(RowAmountArr(3),
> 2)
> + val(txtModTotal.caption) & "," & val(txtAdvance.text) & ",'-'," &
> IIf(Trim(txtHaste.text) <> "", RetriveAccountCode(Trim(txtHaste.text)),
> 0)
> & ")"
> and its output is
> Insert Into
> SalesVoucher(TransactionID,VoucherNo,VoucherDate,D ebitTo,CreditTo,TotalAmt,Discount,ModAmt,ModWt,Oth er,Othertype,TaxPerc,TaxAmt,NetAmt,Advance,Narrati on,Haste)
> Values(18,1831,'07/04/2004',150,'36',11000,0,0,0,-10,'','1.00',109.9,11100,0,'-',0)
> in above query though i used cdate to voucherdate value still it save in
> database as 01/01/1900 though here it shows right date
> plz help me its a very big issue for me & i really just fed of this
> problem|||hi avinash
i have come across such problems frequently. i would advise u
to set the date format within dtpicker control u are using. Check
properties for the control and set the format to custom. then set the
mask.
thats it.

Regards
Debashishsql

Wednesday, March 28, 2012

Problem in deployment of Crystal 10 with VB6

I've facing problem in creating the package for the application using VB6 and Crystal reports 10. What are the support files needed to be included in the package. I've already included Crviewer.dll,CRAXDRT.dll. But there is no response in the client machine.Whether Crystal Reports 10 need to be installed in client machine?

Please respond!

Thanking you,

Regards,
Rajarajan RI found solution to my deployment problems in the next link -->

http://support.businessobjects.com/communityCS/TechnicalPapers/rdc10_deployment.pdf

Monday, March 26, 2012

Problem in creating nullable columns using SELECT INTO in SQL Serv

Hi Everyone!
I have a problem that is basically a database issue in SQL Server 2000
compared to Sybase 12. I am working on a application that should support bot
h
SYbase and SQL Server as backend. My code works fine in Sybase but not in SQ
L
Server. Following is the query that will give a an idea of the issue.
Query:
--
SELECT Null as c1,
isnull( NULL,0) as c2
INTO #temp_tbl
Above query creates both c1 and c2 as nullable columns in Sybase. The same
query in SQL Server creates C1 as nullable and C2 as not null. There are
situation that result in null data and cause inserting NULL into not columns
in SQL Server. Using SET ANSI_NULL_DFLT_ON ON also did not give the required
results. I am looking for a solution which would create c1 and c2 as nullabl
e
columns in SQL Server.
Please help in finding me a solution.
Thanks in advance.
SomeshSRV wrote:
> Hi Everyone!
> I have a problem that is basically a database issue in SQL Server 2000
> compared to Sybase 12. I am working on a application that should support b
oth
> SYbase and SQL Server as backend. My code works fine in Sybase but not in
SQL
> Server. Following is the query that will give a an idea of the issue.
> Query:
> --
> SELECT Null as c1,
> isnull( NULL,0) as c2
> INTO #temp_tbl
> Above query creates both c1 and c2 as nullable columns in Sybase. The same
> query in SQL Server creates C1 as nullable and C2 as not null. There are
> situation that result in null data and cause inserting NULL into not colum
ns
> in SQL Server. Using SET ANSI_NULL_DFLT_ON ON also did not give the requir
ed
> results. I am looking for a solution which would create c1 and c2 as nulla
ble
> columns in SQL Server.
> Please help in finding me a solution.
> Thanks in advance.
> Somesh
Like this:
CREATE TABLE #temp_tbl (c1 INTEGER NULL, c2 INTEGER NULL /* !!! NO
PRIMARY KEY !!! */)
INSERT INTO #temp_tbl (c1, c2)
SELECT ...
Curiously enough, the following seems to give your desired result in
SQL Server 2000 but not in 2005. Which just goes to show the folly of
such proprietary "tricks" as this.
SELECT c1, COALESCE(c2,0) AS c2
INTO T1
FROM (SELECT NULL, NULL) AS T(c1,c2);
David Portas
SQL Server MVP
--|||David Portas wrote:
> Curiously enough, the following seems to give your desired result in
> SQL Server 2000 but not in 2005. Which just goes to show the folly of
> such proprietary "tricks" as this.
> SELECT c1, COALESCE(c2,0) AS c2
> INTO T1
> FROM (SELECT NULL, NULL) AS T(c1,c2);
>
That was just a type coercian issue. The following tests OK on both
2000 and 2005 (8.00.760 and 9.00.1399.06)
SELECT c1, COALESCE(c2,0) AS c2
INTO T1
FROM (SELECT CAST(NULL AS INTEGER),
CAST(NULL AS INTEGER)) AS T(c1,c2);
David Portas
SQL Server MVP
--

problem in connection with SQLServer using DSN

Hi all,
I am using OdbcConnection for coonectivity with SQL Server db. My code
is working fine with windows application but in ASP.NET or in
webservice its raising following exception -
"ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL
Server does not exist or access denied.
ERROR [01000] [Microsoft][ODBC SQL Server Driver]
[DBNETLIB]ConnectionOpen (Connect())."
at System.Data.Odbc.OdbcConnection.Open()
Same code is working fine for Orace DSN.
My code:
OdbcConnection conn = new
OdbcConnection("dsn=MyDsn;uid=sa;pwd=stars;");
conn.Open();
Please help me to sort out this problem
Thanks
Dharmendra
I expect the reason that no one jumped on this question (which has been
asked and answered a million times) is that you're clearly not following the
advice given here and elsewhere. I suggest you do some reading about getting
connected to SQL Server. The 4th through 6th Editions of my Hitchhiker's
Guide to Visual Basic and SQL Server discuss how to connect via ODBC to SQL
Server. However, they do not talk about the fact that recent versions of SQL
Server require that you enable connectivity before attempting to connect.
This is covered in detail in my latest book and in whitepapers posted on my
blog (see www.betav.com/blogs/billva). And be sure to stop using SA
credentials to handle your customer's data...
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
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)
------
"tomar" <dharmendratomar2000@.gmail.com> wrote in message
news:1179209227.270257.149380@.n59g2000hsh.googlegr oups.com...
> Hi all,
> I am using OdbcConnection for coonectivity with SQL Server db. My code
> is working fine with windows application but in ASP.NET or in
> webservice its raising following exception -
> "ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL
> Server does not exist or access denied.
> ERROR [01000] [Microsoft][ODBC SQL Server Driver]
> [DBNETLIB]ConnectionOpen (Connect())."
> at System.Data.Odbc.OdbcConnection.Open()
> Same code is working fine for Orace DSN.
> My code:
> OdbcConnection conn = new
> OdbcConnection("dsn=MyDsn;uid=sa;pwd=stars;");
> conn.Open();
>
> Please help me to sort out this problem
> Thanks
> Dharmendra
>
|||Thanks for response.
I have tested it dsn through Odbcad32 . It gets connected with sql
server db but when I try to connect via ASP.NET code. It gives error.
Important thing is that
when I load the application with same code on other machine. It works
fine.
Regards
Dharmendra,
================================================== =======
On May 17, 1:20 am, "William \(Bill\) Vaughn"
<billvaRemoveT...@.betav.com> wrote:
> I expect the reason that no one jumped on this question (which has been
> asked and answered a million times) is that you're clearly not following the
> advice given here and elsewhere. I suggest you do some reading about getting
> connected to SQL Server. The 4th through 6th Editions of my Hitchhiker's
> Guide to Visual Basic and SQL Server discuss how to connect via ODBC to SQL
> Server. However, they do not talk about the fact that recent versions of SQL
> Server require that you enable connectivity before attempting to connect.
> This is covered in detail in my latest book and in whitepapers posted on my
> blog (seewww.betav.com/blogs/billva). And be sure to stop using SA
> credentials to handle your customer's data...
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speakerwww.betav.com/blog/billvawww.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no rights.
> __________________________________
> Visitwww.hitchhikerguides.netto 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)
> ----X---
> "tomar" <dharmendratomar2...@.gmail.com> wrote in message
> news:1179209227.270257.149380@.n59g2000hsh.googlegr oups.com...
>
>
>
>
>
> - Show quoted text -

problem in connection with SQLServer using DSN

Hi all,
I am using OdbcConnection for coonectivity with SQL Server db. My code
is working fine with windows application but in ASP.NET or in
webservice its raising following exception -
"ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]
SQL
Server does not exist or access denied.
ERROR [01000] [Microsoft][ODBC SQL Server Driver]
[DBNETLIB]ConnectionOpen (Connect())."
at System.Data.Odbc.OdbcConnection.Open()
Same code is working fine for Orace DSN.
My code:
OdbcConnection conn = new
OdbcConnection("dsn=MyDsn;uid=sa;pwd=stars;");
conn.Open();
Please help me to sort out this problem
Thanks
DharmendraI expect the reason that no one jumped on this question (which has been
asked and answered a million times) is that you're clearly not following the
advice given here and elsewhere. I suggest you do some reading about getting
connected to SQL Server. The 4th through 6th Editions of my Hitchhiker's
Guide to Visual Basic and SQL Server discuss how to connect via ODBC to SQL
Server. However, they do not talk about the fact that recent versions of SQL
Server require that you enable connectivity before attempting to connect.
This is covered in detail in my latest book and in whitepapers posted on my
blog (see www.betav.com/blogs/billva). And be sure to stop using SA
credentials to handle your customer's data...
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
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)
----
---
"tomar" <dharmendratomar2000@.gmail.com> wrote in message
news:1179209227.270257.149380@.n59g2000hsh.googlegroups.com...
> Hi all,
> I am using OdbcConnection for coonectivity with SQL Server db. My code
> is working fine with windows application but in ASP.NET or in
> webservice its raising following exception -
> "ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLI
B]SQL
> Server does not exist or access denied.
> ERROR [01000] [Microsoft][ODBC SQL Server Driver]
> [DBNETLIB]ConnectionOpen (Connect())."
> at System.Data.Odbc.OdbcConnection.Open()
> Same code is working fine for Orace DSN.
> My code:
> OdbcConnection conn = new
> OdbcConnection("dsn=MyDsn;uid=sa;pwd=stars;");
> conn.Open();
>
> Please help me to sort out this problem
> Thanks
> Dharmendra
>|||Thanks for response.
I have tested it dsn through Odbcad32 . It gets connected with sql
server db but when I try to connect via ASP.NET code. It gives error.
Important thing is that
when I load the application with same code on other machine. It works
fine.
Regards
Dharmendra,
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D
On May 17, 1:20 am, "William \(Bill\) Vaughn"
<billvaRemoveT...@.betav.com> wrote:
> I expect the reason that no one jumped on this question (which has been
> asked and answered a million times) is that you're clearly not following =
the
> advice given here and elsewhere. I suggest you do some reading about gett=
ing
> connected to SQL Server. The 4th through 6th Editions of my Hitchhiker's
> Guide to Visual Basic and SQL Server discuss how to connect via ODBC to S=
QL
> Server. However, they do not talk about the fact that recent versions of =
SQL
> Server require that you enable connectivity before attempting to connect.
> This is covered in detail in my latest book and in whitepapers posted on =
my
> blog (seewww.betav.com/blogs/billva). And be sure to stop using SA
> credentials to handle your customer's data...
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speakerwww.betav.com/blog/billvawww.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no right=
s=2E
> __________________________________
> Visitwww.hitchhikerguides.netto 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)
> ----=
--=AD---
> "tomar" <dharmendratomar2...@.gmail.com> wrote in message
> news:1179209227.270257.149380@.n59g2000hsh.googlegroups.com...
>
>
>
>
>
>
>
>
> - Show quoted text -sql

Friday, March 23, 2012

problem in Adding NewItem(Database.mdf) in Asp.net project

Hi All,

I am new to Asp.net in my application i want to perform some operations with sql server 2005 database, but whenever i am inserting New Item Database.mdf in Myproject(Myproject -> Add NewItem -> Database.mdf ) its displaying the following warning

Failed to generate a user instance of Sql server due to failure in starting the process for the user instance. The connection will be closed

so that i am unable to insert Database.mdf in my project ..

Any help will be greatly appreciated

Thanks,

Vision.

basicl you need to remove "User instance=true " from your connection string .

also you may need to look at similar problem.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=293667&SiteID=1

|||

Solution: Modify the SQL Server (SQLExpress) service to use your local or system account and restart the service. SQLEXPRESS allows a User-Instance process that can connect to a physical MDF database file directly from the connection string. If the User Instance process does not have permissions, it will fail. You can also ATTACH the database file and use a normal connection string, e.g. server=(local);database=DatabaseName;uid=sa;pwd=yourpass

|||

Hi pbromberg,

Can you please suggest how to modify the Sql Server service to use system account. And also i don't want to connect to a physical MDF database file directly from the connection string.(just i want to add new item datasoure.mdf)

waiting for u r suggestion..

Thanks,

Vision.v1

Wednesday, March 21, 2012

Problem getting information regarding the application connected to

I am using MSDE 2000 ,
I would like to get information from master..sysprocesses table
to see what programs are connected to the database.
I would to verfy how many times a particular program is connected to the
database
Lets say i would like to check the number of times program X is connected to
the
database.
The select statement is like Select * from master..sysprocesses where
program_name ='X'
but unfortunately whenever i connect using programX , the Program_name field
is Empty.
So I am unable to compare against the program name. Is there any other table
from which
i can gather consistent information? Any workaround would also be welcome.
Thanks in advance
Prakash
hi Prakash,
Prakash wrote:
> I am using MSDE 2000 ,
> I would like to get information from master..sysprocesses table
> to see what programs are connected to the database.
> I would to verfy how many times a particular program is connected to
> the database
> Lets say i would like to check the number of times program X is
> connected to the
> database.
> The select statement is like Select * from master..sysprocesses where
> program_name ='X'
> but unfortunately whenever i connect using programX , the
> Program_name field is Empty.
> So I am unable to compare against the program name. Is there any
> other table from which
> i can gather consistent information? Any workaround would also be
> welcome.
> Thanks in advance
> Prakash
ADO automatically provides this kind of information to SQL Server, where
SQL-DMO requires you to explicitely set it like
objServer.ApplicationName = App.EXEName
can you please check your data access model?
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

Tuesday, March 20, 2012

Problem Executing Stored Procedures

We have an application that uses SQL-DMO to get a directory/file list for
the server by calling extended stored procedures, xp_availablemedia and
xp_cmdshell.
The app can successfully navigate the directories on systems running MSDE on
Window 2000 Professional, however, it fails to do so on systems running
Windows XP Professional.
There are no differences in the environment the application runs in other
than the version of Windows. Some of the characteristics of the
installation are: The application and MSDE are installed using the same
scripts on both versions of Windows. The systems where the app is installed
are running as part of a workgroup rather than a domain. We have run
svrnetcn.exe and verified that named pipes and TCP/IP are both enabled. To
confirm SQLDMO is enabled SQLDMO.DLL has been registered successfully from
the command line. Also, we can successfully execute the stored procedures
using SQL statements so it appears that the problems are related to SQLDMO.
Is there something additional or different that needs to be done on XP than
on 2000? Does anyone have any suggestions about how to solve this problem?
Thanks,
Tom
hi Tom,
"news.microsoft.com" <tom@.nospam.waspbarcode.com> ha scritto nel messaggio
news:erdTNo4EEHA.2740@.TK2MSFTNGP11.phx.gbl...
> We have an application that uses SQL-DMO to get a directory/file list for
> the server by calling extended stored procedures, xp_availablemedia and
> xp_cmdshell.
> The app can successfully navigate the directories on systems running MSDE
on
> Window 2000 Professional, however, it fails to do so on systems running
> Windows XP Professional.
> There are no differences in the environment the application runs in other
> than the version of Windows. Some of the characteristics of the
> installation are: The application and MSDE are installed using the same
> scripts on both versions of Windows. The systems where the app is
installed
> are running as part of a workgroup rather than a domain. We have run
> svrnetcn.exe and verified that named pipes and TCP/IP are both enabled.
To
> confirm SQLDMO is enabled SQLDMO.DLL has been registered successfully from
> the command line. Also, we can successfully execute the stored procedures
> using SQL statements so it appears that the problems are related to
SQLDMO.
> Is there something additional or different that needs to be done on XP
than
> on 2000? Does anyone have any suggestions about how to solve this
problem?
I do currently use SQL-DMO with success both on Win2k, WinXP pro and Win2003
server std...
I never had the need to manually register this somponent when installing
MSDE, and both procedures you are mentioning are run with success...
just the usual caveat... does the account running SQL Server and SQL Server
Agent have the right privileges?
did you try some simple SQL-DMO code to test it?
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.7.0 - DbaMgr ver 0.53.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||My guess is that it has nothing to do with SQL-DMO, but is instead a
permissions issue. xp_cmdshell has some rather strict permission issues when
being invoked (its all in the BOL). By default, XP has a tighter security
setup than Win2k, so this may be part of the root of your problem. The fact
that you are running in a Workgroup network may also be a factor, since its
security model is much different than a domain network. Have you tried
running the profiler against the system when running your application
against MSDE on XP?
Jim
"news.microsoft.com" <tom@.nospam.waspbarcode.com> wrote in message
news:erdTNo4EEHA.2740@.TK2MSFTNGP11.phx.gbl...
> We have an application that uses SQL-DMO to get a directory/file list for
> the server by calling extended stored procedures, xp_availablemedia and
> xp_cmdshell.
> The app can successfully navigate the directories on systems running MSDE
on
> Window 2000 Professional, however, it fails to do so on systems running
> Windows XP Professional.
> There are no differences in the environment the application runs in other
> than the version of Windows. Some of the characteristics of the
> installation are: The application and MSDE are installed using the same
> scripts on both versions of Windows. The systems where the app is
installed
> are running as part of a workgroup rather than a domain. We have run
> svrnetcn.exe and verified that named pipes and TCP/IP are both enabled.
To
> confirm SQLDMO is enabled SQLDMO.DLL has been registered successfully from
> the command line. Also, we can successfully execute the stored procedures
> using SQL statements so it appears that the problems are related to
SQLDMO.
> Is there something additional or different that needs to be done on XP
than
> on 2000? Does anyone have any suggestions about how to solve this
problem?
> Thanks,
> Tom
>
|||Andrea,
Both SQL Server and Agent are running under the Local System account so they
should have enough privileges.
The same application that is having problems with SQL-DMO also uses SQL-DMO
to do backups and restores and doesn't have any problems.
Tom
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:c43nsp$2cuegu$1@.ID-207518.news.uni-berlin.de...
> hi Tom,
> "news.microsoft.com" <tom@.nospam.waspbarcode.com> ha scritto nel messaggio
> news:erdTNo4EEHA.2740@.TK2MSFTNGP11.phx.gbl...
for
MSDE
> on
other
> installed
> To
from
procedures
> SQLDMO.
> than
> problem?
> I do currently use SQL-DMO with success both on Win2k, WinXP pro and
Win2003
> server std...
> I never had the need to manually register this somponent when installing
> MSDE, and both procedures you are mentioning are run with success...
> just the usual caveat... does the account running SQL Server and SQL
Server
> Agent have the right privileges?
> did you try some simple SQL-DMO code to test it?
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.7.0 - DbaMgr ver 0.53.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||Jim,
Unfortunately, we have no control over the environment where the application
is being run, but, it is usually installed on stand-alone systems or
pier-to-pier networks that are not part of a domain.
Since we can execute the extended stored procedures in SQL commands, we are
in the process of converting the application so it doesn't use SQL-DMO
except for the backup and restore.
Tom
"J Young" <thorium48@.hotmail.com> wrote in message
news:OTbnG4OFEHA.2052@.TK2MSFTNGP11.phx.gbl...
> My guess is that it has nothing to do with SQL-DMO, but is instead a
> permissions issue. xp_cmdshell has some rather strict permission issues
when
> being invoked (its all in the BOL). By default, XP has a tighter security
> setup than Win2k, so this may be part of the root of your problem. The
fact
> that you are running in a Workgroup network may also be a factor, since
its
> security model is much different than a domain network. Have you tried
> running the profiler against the system when running your application
> against MSDE on XP?
> Jim
> "news.microsoft.com" <tom@.nospam.waspbarcode.com> wrote in message
> news:erdTNo4EEHA.2740@.TK2MSFTNGP11.phx.gbl...
for
MSDE
> on
other
> installed
> To
from
procedures
> SQLDMO.
> than
> problem?
>

Friday, March 9, 2012

Problem deploying reports

Hi,

I have an application that involves 3 components one of which is
Reports.
My system's configuration:
SQL 2000 - Default instance
SQL 2005 - Named instance (Instance1).

I provide the user with an option of selecting the SQL Server instance.
If the user chooses Instance1, then I need to deply the reports in SQL
2005.
The exceptions encountered during installation are logged in the Event
log.
When I do the installation for the in a machine, I always
get the following error in the event log:
Could not connect to the Report Server Database
http://<MachineName>/ReportingServices.asmx.
I tried giving the rs.exe options from commandline. I got an error like:

Error in DetermineReportUrlSecurity().

I don't have the exact error with me now.

Note that I do not get this error when I do the installation in a
machine where both default and named instances are SQL 2005.

Can anyone tell me why this happens?

Thanks,

Sandhya

Are you installing RS2005 on the same machine as RS 2000? If so you should be prompted to do a files only install, is that the case? If it is then I am not sure when you are seeing this error. During configuration? If you could provide the error message and a better description of exactly what you are doing, perhaps I can offer some help.|||

Hi,

I am deploying my reports during the time of installation of my application i.e., throwugh an msi. I deploy the reports using rs.exe command and any error encountered would be logged in event log.

While installing SQL 2005. I selected the option 'Install and configure' for Reporting Services component. I also verified that I am able to browse to the Reports page. So there is no problem with the configuration. Someone had a similar problem which I saw in another forum. There a solution was given as to disable the firewall/create exceptions for report server. But in my system the firewall is already disabled.

I am deploying my reports from the installer by giving the rs.exe command wherein I get the following error:
Could not connect to the Report Server Database
http://<MachineName>/ReportingServices.asmx.

I tried giving the rs.exe from the command line with -t parameter to trace the error.
Folowing is the exact error that I am getting:
Microsoft.ReportingServices.ScriptHost.ScriptHost.DetermineServerUrlSecuri
ty()
at Microsoft.ReportingServices.ScriptHost.ScriptHost.InstanceMain()
at Microsoft.ReportingServices.BaseCmdLine.CommandLineMain(String[] args,
BaseCmdLine instance)

Why do I get this error?


Thanks,
Sandhya

|||

You need to connect to http://machinename/ReportServer/ReportingServices.asmx.

I hope this help.s

|||Hi,
I am connecting to http://machinename/ReportServer/ReportingServices.asmx.
Still I get the error. Any clues as to why I face this problem?
Thanks,
Sandhya|||According to the error the report server does not exist. Does the report server come up if you browse to http://machinename/reportserver? Does http://machinename/reports work?|||

Hi,

For Yukon, the default configuration for the Report page would be:

Default instance - http://<machinename>/reports

Named Instance - http://<machinename>/reports$<InstanceName>

In my case, I have Yukon in the named instance(Instance1). Hence I need to connect to http://<machinename>/reports$Instance1 and I verified that I am able to browse to this page. I get the Reports homepage.

When I browse to http://machinename/reportserver$Instance1, I get the following displayed in the page:

chnshl13423/ReportServer$Instance1 - /



Microsoft SQL Server Reporting Services Version 9.00.1399.00

So what might be the problem?

Thanks,

Sandhya

|||you should pass in -s http://machinename/reportserver$Instance1 to rs.exe.|||

Hi,

I am already giving the following:

rs.exe -i "C:\Pr\DCMReports For Yukon\DeploymentScript\PublishDCMReports.rss" -s "http://chnshl13423/reportserver$Instance1" -v parentFolder="DCM Reports For Yukon" -v reportLocation="C:\Pr\DCMReports For Yukon\DeploymentScript\PublishDCMReports.rss" -v serverName="chnshl13423\Instance1" -v databaseName="DCMSolution"

Thanks,

Sandhya

|||Any suggestions?|||

Hmm, It looks like you are doing everything that you should be. All the script host does at this point is call the soap method ListSecureMethods, using the ReportService2005.asmx endpoint. Your command looks correct and the server is up and running. I really don't know what would be causing this error.

The only thing I can think of is if the user you are running rs.exe as can not be authenticated with RS or RS is setup to use forms or basic auth. You could try using a different user, or if you are using basic auth, pass in the username and password options.

Problem deploying reports

Hi,

I have an application that involves 3 components one of which is
Reports.
My system's configuration:
SQL 2000 - Default instance
SQL 2005 - Named instance (Instance1).

I provide the user with an option of selecting the SQL Server instance.
If the user chooses Instance1, then I need to deply the reports in SQL
2005.
The exceptions encountered during installation are logged in the Event
log.
When I do the installation for the in a machine, I always
get the following error in the event log:
Could not connect to the Report Server Database
http://<MachineName>/ReportingServices.asmx.
I tried giving the rs.exe options from commandline. I got an error like:

Error in DetermineReportUrlSecurity().

I don't have the exact error with me now.

Note that I do not get this error when I do the installation in a
machine where both default and named instances are SQL 2005.

Can anyone tell me why this happens?

Thanks,

Sandhya

Are you installing RS2005 on the same machine as RS 2000? If so you should be prompted to do a files only install, is that the case? If it is then I am not sure when you are seeing this error. During configuration? If you could provide the error message and a better description of exactly what you are doing, perhaps I can offer some help.|||

Hi,

I am deploying my reports during the time of installation of my application i.e., throwugh an msi. I deploy the reports using rs.exe command and any error encountered would be logged in event log.

While installing SQL 2005. I selected the option 'Install and configure' for Reporting Services component. I also verified that I am able to browse to the Reports page. So there is no problem with the configuration. Someone had a similar problem which I saw in another forum. There a solution was given as to disable the firewall/create exceptions for report server. But in my system the firewall is already disabled.

I am deploying my reports from the installer by giving the rs.exe command wherein I get the following error:
Could not connect to the Report Server Database
http://<MachineName>/ReportingServices.asmx.

I tried giving the rs.exe from the command line with -t parameter to trace the error.
Folowing is the exact error that I am getting:
Microsoft.ReportingServices.ScriptHost.ScriptHost.DetermineServerUrlSecuri
ty()
at Microsoft.ReportingServices.ScriptHost.ScriptHost.InstanceMain()
at Microsoft.ReportingServices.BaseCmdLine.CommandLineMain(String[] args,
BaseCmdLine instance)

Why do I get this error?


Thanks,
Sandhya

|||

You need to connect to http://machinename/ReportServer/ReportingServices.asmx.

I hope this help.s

|||Hi,
I am connecting to http://machinename/ReportServer/ReportingServices.asmx.
Still I get the error. Any clues as to why I face this problem?
Thanks,
Sandhya|||According to the error the report server does not exist. Does the report server come up if you browse to http://machinename/reportserver? Does http://machinename/reports work?|||

Hi,

For Yukon, the default configuration for the Report page would be:

Default instance - http://<machinename>/reports

Named Instance - http://<machinename>/reports$<InstanceName>

In my case, I have Yukon in the named instance(Instance1). Hence I need to connect to http://<machinename>/reports$Instance1 and I verified that I am able to browse to this page. I get the Reports homepage.

When I browse to http://machinename/reportserver$Instance1, I get the following displayed in the page:

chnshl13423/ReportServer$Instance1 - /



Microsoft SQL Server Reporting Services Version 9.00.1399.00

So what might be the problem?

Thanks,

Sandhya

|||you should pass in -s http://machinename/reportserver$Instance1 to rs.exe.|||

Hi,

I am already giving the following:

rs.exe -i "C:\Pr\DCMReports For Yukon\DeploymentScript\PublishDCMReports.rss" -s "http://chnshl13423/reportserver$Instance1" -v parentFolder="DCM Reports For Yukon" -v reportLocation="C:\Pr\DCMReports For Yukon\DeploymentScript\PublishDCMReports.rss" -v serverName="chnshl13423\Instance1" -v databaseName="DCMSolution"

Thanks,

Sandhya

|||Any suggestions?|||

Hmm, It looks like you are doing everything that you should be. All the script host does at this point is call the soap method ListSecureMethods, using the ReportService2005.asmx endpoint. Your command looks correct and the server is up and running. I really don't know what would be causing this error.

The only thing I can think of is if the user you are running rs.exe as can not be authenticated with RS or RS is setup to use forms or basic auth. You could try using a different user, or if you are using basic auth, pass in the username and password options.

Problem Database

I am creating an application in V W D I am new to this so please bear with me I have a form that user is to fill out and if it completes it is suppose to update the sql database and then send user to another page and tell them there Ticket Number. I thought I had it working and was using a sql command to tell the ticket number by doing a select Top 1 in descending order to get the last record entered and it worked or so I thought I then looked and found my database was stuck on 10 entries and will not accept any additional records but the application does not throw any errors. Any ideas would be greatly appreciated.

%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link href="http://links.10026.com/?link=css/CAD.css" rel="stylesheet" type="text/css" />
<title>Log the Call</title>

</head>
<body>
<form id="form1" runat="server">
<div>


<asp:TextBox ID="Email" runat="server" Style="z-index: 101; left: 285px; position: absolute;
top: 273px"></asp:TextBox>


<br />
<asp:Label ID="Label1" runat="server" Style="z-index: 103; left: 78px; position: absolute;
top: 169px" Text="First Name" Width="120px"></asp:Label>

<asp:TextBox ID="PhoneX" runat="server" Style="z-index: 104; left: 665px; position: absolute;
top: 266px"></asp:TextBox>
<asp:TextBox ID="RoomN" runat="server" Style="z-index: 105; left: 508px; position: absolute;
top: 188px"></asp:TextBox>
<asp:TextBox ID="LName" runat="server" Style="z-index: 106; left: 288px; position: absolute;
top: 185px"></asp:TextBox>
<br />
<asp:Label ID="Label2" runat="server" Style="z-index: 107; left: 293px; position: absolute;
top: 164px" Text="Last Name" Width="107px"></asp:Label>
<asp:Label ID="Label3" runat="server" Style="z-index: 108; left: 667px; position: absolute;
top: 245px" Text="Phone Extension" Width="117px"></asp:Label>
<asp:Label ID="Label4" runat="server" Style="z-index: 109; left: 286px; position: absolute;
top: 253px" Text="Email Address" Width="114px"></asp:Label>
<asp:Label ID="Label5" runat="server" Style="z-index: 110; left: 510px; position: absolute;
top: 171px" Text="Room Number" Width="104px"></asp:Label>
<asp:Label ID="Label6" runat="server" Style="z-index: 111; left: 78px; position: absolute;
top: 239px" Text="Location" Width="111px"></asp:Label>
<asp:Label ID="Label7" runat="server" Style="z-index: 112; left: 511px; position: absolute;
top: 248px" Text="Problem Type" Width="99px"></asp:Label>
<asp:Label ID="Label8" runat="server" Style="z-index: 113; left: 74px; position: absolute;
top: 329px" Text="Additional Information" Width="119px"></asp:Label>
<asp:TextBox ID="Fname" runat="server" Style="z-index: 114; left: 76px; position: absolute;
top: 187px"></asp:TextBox>
<asp:TextBox ID="AddInfo" runat="server" Height="103px" Style="z-index: 115; left: 69px;
position: absolute; top: 369px" Width="636px"></asp:TextBox>
<asp:Button ID="submit_Button" runat="server" Style="z-index: 116; left: 74px; position: absolute;
top: 500px" Text="Submit Ticket" PostBackUrl="~/LogCallConfirmed.aspx" />

<asp:DropDownList ID="Location" runat="server" Style="z-index: 117; left: 77px; position: absolute;
top: 257px">
<asp:ListItem>Administration</asp:ListItem>
<asp:ListItem>Annex</asp:ListItem>
<asp:ListItem>Billing</asp:ListItem>
<asp:ListItem>Clinic</asp:ListItem>
<asp:ListItem>Contact Lense</asp:ListItem>
<asp:ListItem>Dispensary</asp:ListItem>
<asp:ListItem>SpecialityCare</asp:ListItem>
<asp:ListItem>Spec Lab</asp:ListItem>
<asp:ListItem></asp:ListItem>
<asp:ListItem Selected="True">N/A</asp:ListItem>
</asp:DropDownList>

<asp:RequiredFieldValidator ID="FNameRequired" runat="server" ControlToValidate="Fname"
ErrorMessage="First Name Required" Style="z-index: 118; left: 242px; position: absolute;
top: 191px">*</asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="LNameRequired" runat="server" ControlToValidate="LName"
ErrorMessage="Last Name Required" Style="z-index: 119; left: 445px; position: absolute;
top: 188px">*</asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RoomRequired" runat="server" ControlToValidate="RoomN"
ErrorMessage="Room Number Required" Style="z-index: 120; left: 665px; position: absolute;
top: 191px">*</asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="PhoneXRequired" runat="server" ControlToValidate="PhoneX"
ErrorMessage="Phone Extension Required" Style="z-index: 121; left: 834px; position: absolute;
top: 268px">*</asp:RequiredFieldValidator>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ProblemType"
ErrorMessage="Problem Type Can not be N/A" Style="z-index: 122; left: 622px;
position: absolute; top: 272px">*</asp:RequiredFieldValidator>

<asp:RequiredFieldValidator ID="LocationRequired" runat="server" ControlToValidate="Location"
ErrorMessage="Location can not be N/A" Style="z-index: 123; left: 199px; position: absolute;
top: 259px">*</asp:RequiredFieldValidator>
<asp:DropDownList ID="ProblemType" runat="server" Style="z-index: 124; left: 512px;
position: absolute; top: 266px">
<asp:ListItem>Hardware</asp:ListItem>
<asp:ListItem>Software</asp:ListItem>
<asp:ListItem>Network</asp:ListItem>
<asp:ListItem>Unknown</asp:ListItem>
<asp:ListItem Selected="True">N/A</asp:ListItem>
</asp:DropDownList>
<asp:RegularExpressionValidator ID="EmailValidator1" runat="server" ControlToValidate="Email"
ErrorMessage="Please enter valid E-mail address" Style="z-index: 125; left: 442px;
position: absolute; top: 276px" ValidationExpression="\w+([-+.']\w+)*@.\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
<asp:ValidationSummary ID="CallLogValidationSummary" runat="server" Style="z-index: 126;
left: 301px; position: absolute; top: 491px" />

<asp:Literal ID="TicketN" runat="server"></asp:Literal>
<asp:Literal ID="TimeDateStamp" runat="server"></asp:Literal></div>
</form>
</body>
</html>


chalakki:

by doing a select Top 1 in descending order to get the last record entered and it worked or so I thought

This is not a desirable methodology. What happens when multiple users are working in your application? You cannot really guarantee that the highest ticket number is the same record that was just inserted, as another insert might sneak in there before the highest ticket number is retrieved.

chalakki:

I then looked and found my database was stuck on 10 entries and will not accept any additional records but the application does not throw any errors. Any ideas would be greatly appreciated.

You've not shown us any of your data access code, so we really don't have anything to go on to help you. Have you done any debugging?

|||

Default.aspx.vb

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub submit_Button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles submit_Button.Click
Dim PTicket As New SqlDataSource
PTicket.ConnectionString = ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").ToString()
PTicket.InsertCommandType = SqlDataSourceCommandType.Text
PTicket.InsertCommand = "INSERT INTO PTicket (LName, Fname, RoomN, Location, Email, ProblemType, PhoneX, AddInfo, TimeDateStamp)VALUES(@.LName, @.Fname, @.RoomN, @.Location, @.Email, @.ProblemType, @.PhoneX, @.AddInfo, @.TimeDateStamp)"
PTicket.InsertParameters.Add("LName", LName.Text)
PTicket.InsertParameters.Add("FName", Fname.Text)
PTicket.InsertParameters.Add("RoomN", RoomN.Text)
PTicket.InsertParameters.Add("Location", Location.Text)
PTicket.InsertParameters.Add("Email", Email.Text)
PTicket.InsertParameters.Add("ProblemType", ProblemType.Text)
PTicket.InsertParameters.Add("PhoneX", PhoneX.Text)
PTicket.InsertParameters.Add("AddInfo", AddInfo.Text)
'PTicket.InsertParameters.Add("TicketN", TicketN.Text)
PTicket.InsertParameters.Add("TimeDateStamp", DateTime.Now())
'PTicket.InsertParameters.Add("LName", LName.Text)
Dim rowsAffected As Integer = 0
Try
rowsAffected = PTicket.Insert()
Catch ex As Exception
'TO Do: Probably would want to write to windows error logs

Server.Transfer("LogCallProblem.aspx")
Finally
PTicket = Nothing
End Try
If rowsAffected <> 1 Then
Server.Transfer("LogCallProblem.aspx")
Else
Server.Transfer("LogCallConfirmed.aspx")
End If

End Sub
End Class

LogCallConfirm.aspx

</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString1 %>"
SelectCommand="SELECT TOP (1) TicketN FROM PTicket ORDER BY TicketN DESC"></asp:SqlDataSource>

</div>
</form>

Sorry this all new to me! I have never tried using a forum to resolve problems Any assitance would be greatly appreciated

|||I am a little confused. You said it had all seemed to be working. Does this mean that you are seeing the TicketN value incrementing?|||

OK the issue is the page forwards the user to a confirm page when the user imputs the data and hits submit, Then if no exceptions the user is sent to the Confirm Page. There the page is suppose to look up the TicketN Number and displays it to the page so user has a reference to look up, but number 11 is all it displays. The fist time I thought it and enter another page it also displayed 11 so I went to the admin page to view the table there is no additional rows have been added.

I am really confused about it as I get no erros on debug. Also if there is another alternative to giving the user there TicketN number on the confirmation page I am all for it.

Thanks

|||

Sorry to answer your question it is not incrementing and no new data is being added to the table

|||OK, what's happening is that your button's click event is not even running, due to the presence ofPostBackUrl="~/LogCallConfirmed.aspx". This is posting your form to the LogCallConfirmed.aspx page, which is not what you want. Remove this attribute and value altogether and the form will now post back to itself, calling your click event as you desire.|||

Apparently I am missing something. I tried the information you posted and I still can not add to the database. I have even tried creating a new form with not reference to the LogcallConfirmed or Problem page and I still can't place information into the database. I will continue to see what I can do if you have any ideas on where else I could be going wrong I would appreciate any advice you can offer. Thanks in advance

|||Are you seeing any error messages at this point? Maybe you can post your new (presumably simpler) form if you are still having problems with it. If you still have error handling code in it, be sure that you are not just "swallowing" the error but are actually giving some sort of indication that an error occurred.

Saturday, February 25, 2012

Problem creating ASPNETDB under SQL Server 2005

Hi All... We're cloning an application currently under development on Server 2003 / SQL Server 2005 / dotnet 2.0. The clone's going to live on an XPSP2 box with SQL Server 2003 - it's for demo purposes... The application's able to get to our own database, but it's having a hard time creating the ASPNETDB that dot net likes to have.

Aside from the OS, the only difference between the two SQL Servers is that on the working system, we're using windows authentication on the database while on the non-working system, we're using SQL Server authentication. But we've tuned the connection strings appropriately - again, we can get to our own db just fine.

We have the following lines in our web.config:

<connectionstrings>
<clear />
<add name="LocalSqlServer" connectionstring="Server=localhost; Database=ASPNETDB; UID=sa; PWD=mypassword" />
</connectionstring>

On the working system, the Server is an actual IP address, integrated security is set to true, and of course the uid/pwd is a bit different. But again, using a very similar connection string, we able to get to OUR database on the non-working system...

The error we're getting at runtime is:

Cannot open database "ASPNETDB" requested by the login. The login failed. Login failed for user 'sa'.

When we poke into the database from SQL Server Management Studio - on a remote machine - we can see our own database is there, but the ASPNETDB isnt there. Yet... I suspect it failing getting in to just create the db...

Any thoughts? Thanks for the help!!! -- Curt

Did you Attach the aspnet db to the server?

|||

Thanks for the reply, Lock. Good question - and the answer is no. I did that and it worked. I guess somehow I thought ASPNET would create the database if it wasnt there - after all, I swear when using 2005 Express, if I delete the mdf, it magically comes back. Perhaps not... Back on my bike though - many thanks. -- Curt

Monday, February 20, 2012

Problem converting C application from using DBLIB bcp to using ODBC bcp.

I have an application that was converted from using DBLIB bcp to using ODBC bcp. All other field/data types bind are updated correctly, but dates put in the date

1753-01-01 00:00:00.000 when it should be NULL. The variable is a char [24] and the first item is set to \0 ( dbLoanBankruptcy.MotionforReliefReqDate[0] = NullChar; ).

Is there any example or way to put the date in as null when the variable is null and an actual date as needed?

bcp_bind(LoanBankruptcyDBPPtr, (BYTE *)&dbLoanBankruptcy.MotionforReliefReqDate, 0, 23, NULL, 0, SQLCHARACTER, 13)

Thank you,

Joel

Following site maybe helpful:

http://msdn2.microsoft.com/en-us/library/aa198011(sql.80).aspx

|||The link above only discusses dates enough to get an actual date into a table, but does not discuss how to get a NULL date stored. Is there a way to save <NULL>?

Would it be wrong to use the bcp_bind statement you needed for each row/record and re-bind each time? As in...

if(dbLoanBankruptcy.MotionforReliefFiledDate[0]==NullChar) {
if (bcp_bind(LoanBankruptcyDBPPtr, (BYTE *)&dbLoanBankruptcy.MotionforReliefFiledDate,0, SQL_NULL_DATA, NULL, 0, SQLVARCHAR, 14) == FAIL) LogBindError("LoanBankruptcy", "MotionforReliefFiledDate",LoanBankruptcyDBPPtr);
}else{
if (bcp_bind(LoanBankruptcyDBPPtr, (BYTE *)&dbLoanBankruptcy.MotionforReliefFiledDate,0, 23, NULL, 0, SQLVARCHAR, 14) == FAIL) LogBindError("LoanBankruptcy", "MotionforReliefFiledDate",LoanBankruptcyDBPPtr);
}

|||

You don't need to rebind each time

http://msdn2.microsoft.com/en-gb/library/aa177853(SQL.80).aspx

struct

{

int iIndicator;

char szDatetime[30];

} urBCPData;

if (bcp_bind(om_hDbc2, (LPCBYTE) &urBCPData, 4, SQL_VARLEN_DATA , NULL, 0,SQLVARCHAR, 1) == FAIL)

{

// Raise error and return.

return;

}

// Insert NULL

urBCPData.iIndicator = SQL_NULL_DATA;

if (bcp_sendrow(om_hDbc2) == FAIL)

{

// Raise error and return.

return;

}

// Insert 1753-01-01 00:00:00.000

urBCPData.iIndicator = 23;

strcpy(urBCPData.szDatetime, "1753-01-01 00:00:00.000");

if (bcp_sendrow(om_hDbc2) == FAIL)

{

// Raise error and return.

ShowSQLError(om_hDbc2, om_hStmt2);

return;

}

|||Tested and works... thanks.

The normal bind statement but the data portion is now (byte *)&data.datetime_struct

Code Snippet

if(dbLoanBankruptcy.MotionforReliefReqDate[0]==NullChar) {
dbLoanBankruptcy.bounddate.iIndicator = SQL_NULL_DATA;
}else{
dbLoanBankruptcy.bounddate.iIndicator = 24;
strcpy(dbLoanBankruptcy.bounddate.iValue, dbLoanBankruptcy.MotionforReliefReqDate);
}

Problem convert varbinary to float

Hello I have some problems with converting varbinary to float in T-SQL
stored procedure. In my C# application i have table of structures with
double type fields. Size of this table is variant. I have to send this
table to SP. Because of performance i want to send it only once and
whole. So I have to cut this varbinary blob in my Stored procedure to
receive structure field values. But I have problems with double fields
- conversion from varbinary to float in T-SQL is not allowed. Please
halp me - thx for any advise.
MaciejMaciej (maciej_ty@.poczta.onet.pl) writes:
> Hello I have some problems with converting varbinary to float in T-SQL
> stored procedure. In my C# application i have table of structures with
> double type fields. Size of this table is variant. I have to send this
> table to SP. Because of performance i want to send it only once and
> whole. So I have to cut this varbinary blob in my Stored procedure to
> receive structure field values. But I have problems with double fields
> - conversion from varbinary to float in T-SQL is not allowed. Please
> halp me - thx for any advise.

It is not clear how you send this table to SQL Server, but it sounds
like you are sending a binary string. This sounds messy.

The best is probably to format the data as XML, and then use
sp_xml_prepearedocument and OPENXML to unpack the data on the SQL Server
side.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Problem connection to SQL Server with ODBC

Hi,
Getting very frustrated by the following problem, using SQL Server 2000 (inc
SP3a), using an application that connects to a DB via ODBC and the following
error message comes up:
Connection failed:
SQLSTATE: '01000'
SQL Server Error: 1703
[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen
(Connect()).
Connection failed:
SQLState: '08001'
SQL Server Error:17
[Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server doe
s not exist
or access denied
When setting up the DSN the test works fine as does query analyzer, pretty
sure it's not the application I'm using as the SQL server connection window
that comes up after the initial error (above) gives the same error message.
Any ideas? Help is definitely needed before I tear my hair out!
Thanks
IanWhat protocols are being used by the client and what is the
server listening on?
Are the client network utilities on the clients having the
connectivity problems?
Are you using an alias for the connection?
What version of MDAC on the clients?
From your description, it sounds like the app tries to
connect twice (which is fine) but that it's just not hitting
the right protocols. You can find information on how a
client runs through the protocols trying to connect in this
article:
INF: SQL Server Clients May Change Protocols When They Try
to Connect
http://support.microsoft.com/?id=328383
You can also find some general troubleshooting for the error
at:
INF: Potential Causes of the "SQL Server Does Not Exist or
Access Denied" Error Message
http://support.microsoft.com/?id=328306
-Sue
On Tue, 6 Apr 2004 10:12:37 +0100, "Ian Spanswick"
<ian.spanswick@.eps-hq.co.uk> wrote:

>Hi,
>Getting very frustrated by the following problem, using SQL Server 2000 (in
c
>SP3a), using an application that connects to a DB via ODBC and the followin
g
>error message comes up:
>Connection failed:
>SQLSTATE: '01000'
>SQL Server Error: 1703
>[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpe
n
>(Connect()).
>Connection failed:
>SQLState: '08001'
>SQL Server Error:17
>[Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server do
es not exist
>or access denied
>When setting up the DSN the test works fine as does query analyzer, pretty
>sure it's not the application I'm using as the SQL server connection window
>that comes up after the initial error (above) gives the same error message.
>Any ideas? Help is definitely needed before I tear my hair out!
>Thanks
>Ian
>|||Thanks for the links, studying them now but have moved my database to
another server and things are going better! Still want to get to the bottom
of the problem.
Ian
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:i3i670lutthh68l5mqlgn479ng66ornom3@.
4ax.com...
> What protocols are being used by the client and what is the
> server listening on?
> Are the client network utilities on the clients having the
> connectivity problems?
> Are you using an alias for the connection?
> What version of MDAC on the clients?
> From your description, it sounds like the app tries to
> connect twice (which is fine) but that it's just not hitting
> the right protocols. You can find information on how a
> client runs through the protocols trying to connect in this
> article:
> INF: SQL Server Clients May Change Protocols When They Try
> to Connect
> http://support.microsoft.com/?id=328383
> You can also find some general troubleshooting for the error
> at:
> INF: Potential Causes of the "SQL Server Does Not Exist or
> Access Denied" Error Message
> http://support.microsoft.com/?id=328306
> -Sue
> On Tue, 6 Apr 2004 10:12:37 +0100, "Ian Spanswick"
> <ian.spanswick@.eps-hq.co.uk> wrote:
>
(inc
following
exist
pretty
window
message.
>

Problem connecting to sql server express

Hi Guys

i have a problem with my asp.net 2.0 application, I'm trying to connect to sql server database but it gives the following error:

System.Data.SqlClient.SqlException: Cannot open database "MyDatabase" requested by the login. The login failed.
Login failed for user 'Myserver\ASPNET'.

Before i had my application on File System and it was connecting fine, now I moved it to IIS and it doesn't work anymore.

Connection at Web.Config file :

configuration>

<appSettings>

<addkey="ConnectionString"value="server=(local)\SQLEXPRESS; Trusted_Connection=true; database=MyDatabase"></add>

</appSettings>

<connectionStrings/>

How do i create login for that user?

Thanks

Hi, the ASPNET is the IIS account. You can take a look at this post:

http://forums.asp.net/thread/1356875.aspx

|||

Thanks Iori_Jay

That post really helped me, it's working now.