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

Thursday, March 22, 2012

Check if MSDE Installation is done

Hi everybody,
I already wrote about our job to build an setup installation including:
..net, msde, my application (using WISE InstallBuilder).
As everyone know, the MSDE setup makes a fork process and return the control
to the next step.
The next step is to install the DB, but I've to wait for it until the MSDE
setup is done.
I read on this NG something about it, but we tried with another solution:
After MSDE setup, wise installer makes a loop until he's able to start the
instance service.
When the Service is started up it's possible to work by OSQL tool.
On Windows98 OS we're not able to check if a service is running or not.
Where are we getting wrong ?
Thank in advance, Pierluigi.
Windows Millennium Edition and Windows 98 do not have a component that
corresponds to Window NT or Windows 2000 services. The SQL Server database
engine and SQL Server Agent run as executable programs on Windows Millennium
Edition and Windows 98.
Dylan
"Pierluigi Terzoli" <pierluigi_terzoli@.hotmail.com> wrote in message
news:uie0TRZZEHA.1264@.TK2MSFTNGP11.phx.gbl...
> Hi everybody,
> I already wrote about our job to build an setup installation including:
> .net, msde, my application (using WISE InstallBuilder).
> As everyone know, the MSDE setup makes a fork process and return the
control
> to the next step.
> The next step is to install the DB, but I've to wait for it until the MSDE
> setup is done.
> I read on this NG something about it, but we tried with another solution:
> After MSDE setup, wise installer makes a loop until he's able to start the
> instance service.
> When the Service is started up it's possible to work by OSQL tool.
> On Windows98 OS we're not able to check if a service is running or not.
> Where are we getting wrong ?
> Thank in advance, Pierluigi.
>
|||Hi Dylan,
Thanks, we just realised about it a few minutes ago.
How can I know when the MSDE installation is done on W/98 using batch file
or Wise InstallBuilder ?
Pierluigi.
"Dylan Kruger" <carmellobear1@.hotmail.com> ha scritto nel messaggio
news:e8DgIDaZEHA.1048@.tk2msftngp13.phx.gbl...
> Windows Millennium Edition and Windows 98 do not have a component that
> corresponds to Window NT or Windows 2000 services. The SQL Server database
> engine and SQL Server Agent run as executable programs on Windows
Millennium[vbcol=seagreen]
> Edition and Windows 98.
> Dylan
> "Pierluigi Terzoli" <pierluigi_terzoli@.hotmail.com> wrote in message
> news:uie0TRZZEHA.1264@.TK2MSFTNGP11.phx.gbl...
> control
MSDE[vbcol=seagreen]
solution:[vbcol=seagreen]
the
>
|||Ok,
after trying several times we were able to find a way to do it.
Maybe could be useful for something:
- we launch the MSDE setup with a log file (an error file)
- after launching we loop until the log file is not in use
So, we can mount the database and install out application.
Thanks again for yours suggestions.
Pierluigi.
"Pierluigi Terzoli" <pierluigi_terzoli@.hotmail.com> ha scritto nel messaggio
news:%23jzdAIaZEHA.384@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Hi Dylan,
> Thanks, we just realised about it a few minutes ago.
> How can I know when the MSDE installation is done on W/98 using batch file
> or Wise InstallBuilder ?
> Pierluigi.
> "Dylan Kruger" <carmellobear1@.hotmail.com> ha scritto nel messaggio
> news:e8DgIDaZEHA.1048@.tk2msftngp13.phx.gbl...
database[vbcol=seagreen]
> Millennium
including:[vbcol=seagreen]
> MSDE
> solution:
> the
not.
>
|||You can handle msde2000 setup process if you use original msde setup files.
In documentation evens says that you can handle callback msi return codes.
Type Callback = mydll!mycallbackfunction.
Bu ti don't know how to do it in vb.
Try this one :
"e:\msde2000setup\installdir\SETUP\SQLRUN01.MS I" /settings
"D:\develop\servis\setup.ini" /i /L*v "D:\develop\servis\MSDE_setup.log"
CmdLine = "e:\msde2000setup\installdir\SETUP\SQLRUN01.MS I" /settings
"D:\develop\servis\setup.ini" /i /L*v "D:\develop\servis\MSDE_setup.log"
You can easily get required dll declarations on the net.
Or in vb :
start.cb = Len(start)
ret = CreateProcessA(0&, CmdLine, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&,
0&, start, Proc)
i = 0
Do
ret = MsgWaitForMultipleObjects(1&, Proc.hProcess, 0&, INFINITE, _
(QS_POSTMESSAGE Or QS_SENDMESSAGE))
If ret = (WAIT_OBJECT_0) Then
Exit Do 'The process ended.
End If
OpenForms = DoEvents()
If i = 99999 Then
CloseHandle (Proc.hProcess)
sErrMsg = "Not responding"
End If
i = i + 1
Loop
ret = CloseHandle(Proc.hProcess)
ExecCmd = True
Regards
|||And the (poorly documented) /wait switch to the setup.exe command line for
the MSDE installation. This will force the process to wait for the MSDE
installation to finish and return the return code of the MSDE installation.
Jim
"Pierluigi Terzoli" <pierluigi_terzoli@.hotmail.com> wrote in message
news:uie0TRZZEHA.1264@.TK2MSFTNGP11.phx.gbl...
> Hi everybody,
> I already wrote about our job to build an setup installation including:
> .net, msde, my application (using WISE InstallBuilder).
> As everyone know, the MSDE setup makes a fork process and return the
control
> to the next step.
> The next step is to install the DB, but I've to wait for it until the MSDE
> setup is done.
> I read on this NG something about it, but we tried with another solution:
> After MSDE setup, wise installer makes a loop until he's able to start the
> instance service.
> When the Service is started up it's possible to work by OSQL tool.
> On Windows98 OS we're not able to check if a service is running or not.
> Where are we getting wrong ?
> Thank in advance, Pierluigi.
>
sql

Monday, March 19, 2012

Check for column & insert

Can you tell me if this is possible? (and how to do it!!)

The application is VS2005, with sql database.

I want to check if a specific column exists in a specific table in the database and if not then add it, all via my application.

I'm happy knowing how to connect to the database & pass sql commands (as I'm doing that anyway to set off backups), but not the actual queries I'd need.

Hi,

Yes it is possible. This is an example (SQL 2005) that adds the column NewColumn to the Person.Contact table (AdventureWorks) if the column does not exists.

IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'Person'
AND TABLE_NAME = 'Contact'
AND COLUMN_NAME = 'NewColumn')
BEGIN
ALTER TABLE Person.Contact
ADD NewColumn int
END

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||

Great thanks,

got that working now...

Sunday, March 11, 2012

Check Constraint ot Instead of trigger ?

Hi All.. I have a vendor supplied application that writes to a very large
table. I have identified a set of data that the vendors client software send
s
the database that we do not use, but adds 1 million rows of data each day.
I've added an "After" trigger to delete this data as it gets inserted, but
I'm searching for a way from keeping it from getting inserted in the first
place. I can create a check constraint or an instead of trigger. The docs
say use contraints when you can, but does anyone have a different opinion as
how to redirect data to the bit bucket and not insert it into the table ?
And, no the vendor won't help and I can't say who it is ? :>Is the Vendor insert coming from a Strored Procedure? If so, implement your
logic inside the stored procedure before even doing anything to the table
itself.
"JohnW" wrote:

> Hi All.. I have a vendor supplied application that writes to a very large
> table. I have identified a set of data that the vendors client software se
nds
> the database that we do not use, but adds 1 million rows of data each day.
> I've added an "After" trigger to delete this data as it gets inserted, but
> I'm searching for a way from keeping it from getting inserted in the first
> place. I can create a check constraint or an instead of trigger. The docs
> say use contraints when you can, but does anyone have a different opinion
as
> how to redirect data to the bit bucket and not insert it into the table ?
> And, no the vendor won't help and I can't say who it is ? :>|||On Wed, 26 Apr 2006 14:09:02 -0700, JohnW wrote:

>Hi All.. I have a vendor supplied application that writes to a very large
>table. I have identified a set of data that the vendors client software sen
ds
>the database that we do not use, but adds 1 million rows of data each day.
>I've added an "After" trigger to delete this data as it gets inserted, but
>I'm searching for a way from keeping it from getting inserted in the first
>place. I can create a check constraint or an instead of trigger. The docs
>say use contraints when you can, but does anyone have a different opinion a
s
>how to redirect data to the bit bucket and not insert it into the table ?
>And, no the vendor won't help and I can't say who it is ? :>
Hi John,
Adding a CHECK constraint will prevent the insertion of the data and
throw an error. Also, if 100 rows are inserted in a single INSERT
statement and 1 fails the CHECK constraint, they are all rejected. If
this is the behaviour you need, AND the thrid party application can
handle the error condition raised by the CHECK contraint, use it.
Otherwise, use an INSTEAD OF trigger. That can prevent insertion of all
rows, or of only the offending rows, without sputtering error messages
to the client.
Hugo Kornelis, SQL Server MVP|||Just another solution, though if u can do it in the SP thats the best way..
You can use a for insert trigger and
check if the insert should happen, if not rollback the transaction.
like this
(this not syntax.. just pseudo code) check this anyways
create trigger t1 "for insert" on tbl1
begin
if condition = false
rollback tran
end

Thursday, March 8, 2012

Check connectivity Sql Server

Hello all, I am hoping this is the correct place for this. I have an application that depends on an active connection to Sql Server Express 2005. I am looking for a way is any to check for the existance ofthe server I defined and wether it is online or not. I know I can just catch the error on connection but it takes a bit and I have customers trying to cancel it before it's finished because they think it's locked up. I would like a quick way to check without trying to create a connection if it's online, then if it is, proceed, if not, let the customer know. I was hoping for something like a database server ping of sorts.

Thank you,

Jim

Still, the best/reliable way to check whether you can reach the server instance is connect to it. If you think the lock up time is too long considering that the server is down, you can adjust the connection timeout to be smaller than on-default value. There is caveat to this approach if your target machine is unreachable in the network, which may cause a single physical operation, tcp connection to take long time to finish.

Another way on top of my head is to check service manager of your targeted machine using console commmand "SC" and check the server status, an example is the following. The

>sc \\servername query mssqlserver

SERVICE_NAME: mssqlserver
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0

-HTH

Check box in a Combo Box

Hi,
Iam working on a window application using .NET framework 2.0.
I want a check box + some text in a combobox.
User can select multiple items in combo box by using the check
box.
My requirement is : I have a report page. User selects some data
and click on 'Show Report'. Iam showing (I must show) the report also
in the same page. When user selects some other data, and click on 'Show
Report' button new data will be populated.
On this page I have an "Items" Combo box. User may select more than one
Item. Since multi selection property is not there for combo box, Iam
forced to go for ListBox. But Listbox is occupying more space and the
look is bad.
I have seen a CheckedComboBox article here:
http://www.codeproject.com/combobox...&forumid=114...
Its in VC++ I think. I need the same kind of functionality in .NET.
I hope its possible. But dont know how to start with it.
I tried creating a class that is inherited from ComboBox. The class
contains a CheckBox, ItemText Properties. But whats next? Iam unable to
proceed. Could you please help..........
Any ideas or code snippet........ Please............
Regards,
Bharathi Kumar.Please post this to a .Net programming group.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Bharathi Kumar" <bharathidotnet@.gmail.com> wrote in message
news:1149768936.113891.259960@.u72g2000cwu.googlegroups.com...
Hi,
Iam working on a window application using .NET framework 2.0.
I want a check box + some text in a combobox.
User can select multiple items in combo box by using the check
box.
My requirement is : I have a report page. User selects some data
and click on 'Show Report'. Iam showing (I must show) the report also
in the same page. When user selects some other data, and click on 'Show
Report' button new data will be populated.
On this page I have an "Items" Combo box. User may select more than one
Item. Since multi selection property is not there for combo box, Iam
forced to go for ListBox. But Listbox is occupying more space and the
look is bad.
I have seen a CheckedComboBox article here:
http://www.codeproject.com/combobox...&forumid=114...
Its in VC++ I think. I need the same kind of functionality in .NET.
I hope its possible. But dont know how to start with it.
I tried creating a class that is inherited from ComboBox. The class
contains a CheckBox, ItemText Properties. But whats next? Iam unable to
proceed. Could you please help..........
Any ideas or code snippet........ Please............
Regards,
Bharathi Kumar.

Wednesday, March 7, 2012

charts in Reporting Services

hey there

Happy New Year to you all.

in RS 2005

in layout tab

I have four columns in my table

col 1 (group on Company)

col 2 (group on application)

col 3 (count on id no) // total field (count/idno) // max/idno)

col 4 (graph) as I want this to show line by line (visual statement)

I read you need to put that max field in to help with graph. in the Y axis Max field

Unfortunately I either didn't read it properly or I am doing something really wrong.

My graph is not showing correctly - eg one line has 2 in it and is showing more than a line that has 227.

call id is in data of the graph

company name is in series of the graph

can someone explain what I am doing wrong please

thanks

jewel

Anyone able to help here would like to see examples of people using these graphs!

Can someone help with some examples they are using?

Is someone using these without writing extra code etc?

cheers

Sunday, February 19, 2012

Chart does not show up untill cookies allowed

We have web server with web application on one server and SQL Server with
Reporting Services on another. We try to implement reporting on internet, but
for some reason charts in reports not displayed untill cookies from Reporting
Services server (not web server) on client side are not enabled.
Does anubody has solution or ideas?
ThanksI found the solution. The value for UseSessionCookies was "true", I changed
it to "false" (in Configuration table).

Tuesday, February 14, 2012

Characters might change in text field values?

I am using a SQL Server 2000 database as the base of my application.
One of the tables stores saved user defined query information. I then use the values stored here to recreates user queries for data.
The problem is that when I get back to the table to retrieve data some characters are changed which leads to some application errors.
For example let's say my user wants to serach information based on info location. So he chosses to see all the results from distinct cities (Lisboa, Faro, Santarém and Setúbal). He does and he wants to retrieve the same info again when he returns to the
app, so he saves the query (and my application stores the select statement on a table field (this field is a text field)). When he returns to the app, he retrieves his sabed query and I get an SQL error, stating problems in the SQL statement. When I get
there to check for the statement I get a couple of '&' characters on strange places.
I am shure that is not a programming syntax error since I check the select statement just before it is stored.
Any idea what might be causing this?
I am using SQL Server 2000 SP3 english settings, Windows xp sp1 for the client app english version with portuguese locale settings.
What is the datatype for the column in which you are storing these values?
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
|||Hi. It's using the char datatype. The size is growing as needed.
"Vikram Jayaram [MS]" wrote:

> What is the datatype for the column in which you are storing these values?
> Vikram Jayaram
> Microsoft, SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
>
>
|||Have you tried using nvarchar or nchar? Same results?
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
|||Same results.
"Vikram Jayaram [MS]" wrote:

> Have you tried using nvarchar or nchar? Same results?
> Vikram Jayaram
> Microsoft, SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
>
>

Characters might change in text field values?

I am using a SQL Server 2000 database as the base of my application.
One of the tables stores saved user defined query information. I then use th
e values stored here to recreates user queries for data.
The problem is that when I get back to the table to retrieve data some chara
cters are changed which leads to some application errors.
For example let's say my user wants to serach information based on info loca
tion. So he chosses to see all the results from distinct cities (Lisboa, Far
o, Santarém and Setúbal). He does and he wants to retrieve the same info a
gain when he returns to the
app, so he saves the query (and my application stores the select statement o
n a table field (this field is a text field)). When he returns to the app, h
e retrieves his sabed query and I get an SQL error, stating problems in the
SQL statement. When I get
there to check for the statement I get a couple of '&' characters on strange
places.
I am shure that is not a programming syntax error since I check the select s
tatement just before it is stored.
Any idea what might be causing this?
I am using SQL Server 2000 SP3 english settings, Windows XP sp1 for the clie
nt app english version with portuguese locale settings.What is the datatype for the column in which you are storing these values?
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.|||Hi. It's using the char datatype. The size is growing as needed.
"Vikram Jayaram [MS]" wrote:

> What is the datatype for the column in which you are storing these values?
> Vikram Jayaram
> Microsoft, SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
>
>|||Have you tried using nvarchar or nchar? Same results?
Vikram Jayaram
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.|||Same results.
"Vikram Jayaram [MS]" wrote:

> Have you tried using nvarchar or nchar? Same results?
> Vikram Jayaram
> Microsoft, SQL Server
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.
>
>

Character String Query Doesnt Fill Dataset

I'm working in a ASP.NET 2.0 application with a SQL Server 2000 database on the back end. I have a strongly typed dataset in the application that calls a stored procedure for the select. I'm having trouble filling the dataset at runtime though.

I am trying to use a character string query because I setup different columns to be pulled from a table each time and in a different order so my T-SQL looks like this:

set @.FullQuery = 'Select ' + @.FieldsinOrder + ' from tblExample'
exec (@.FullQuery)

This works fine in query analyzer. The results return and display correctly. However, when I run the application, the dataset does not get filled. It is like the results do not output to the application.

If I change the query to be a normal select it works. For example:

select * from tblEmample

That works fine. What is it about a select query setup as a character string and then executed that ASP.NET doesn't like?

try to build your command in ASP and pass it to SQL command command object

like:

Dim

yourCommandAs SqlClient.SqlCommand =New SqlClient.SqlCommand(" 'Select '" + FieldsinOrder + '" from tblExample"', yourconnection)
yourCommand.CommandType = CommandType.Text

Maybe it will work.

When your use Exec to execute query inside query is possible that result from this exec is not visible to ASP.NET code as valid result.

Thanks

Character Set (code page)

I have to test an application under a Greek version of Windows.
I heave installed Windows XP - Greek. The Greek characters appears OK in the application contros (edits), but Crystal Reports viewer continues showing U.S.English character set.
Please, does anybody know how to set Greek character set for the Crystal Reports?
Any clue should be very appreciated.
Thanks!I've got the same problem. :confused:|||Hey, crystalreportsgurus around the world, wake up!

Character Field Formats

I was wondering what everyone felt about the fomats in character
fields where the front end application accepts anything.

I wouldn't want a customer table where the customer name was lower
case on one, upper on another and who knows on the third.

If character fields are not consistent, then formatting will have to
happen every time someone access the data for reporting - as an
example ...

Thanks,

CraigCraigSomberg (csomberg@.dwr.com) writes:
> I was wondering what everyone felt about the fomats in character
> fields where the front end application accepts anything.
> I wouldn't want a customer table where the customer name was lower
> case on one, upper on another and who knows on the third.
> If character fields are not consistent, then formatting will have to
> happen every time someone access the data for reporting - as an
> example ...

I'm not really sure what you are asking here. Indeed, permitting only
uppercase bodes for consistency. But permitting mixed case does give
a more friendly appearence. Having the app to enforce a certain case by
captilalizing the first letter in each part of the name, is unfortunately
not always that bright. For instance, it's Ludwig van Beethoven, but
Van Morrison.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

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

Sunday, February 12, 2012

char type in MS SQL

Dear All,

I am new to MS SQL. One VB application that I need to maintain using it.
There is one problem reported but I couldn't explain: one field is declared
as Char (20), but the application seems able to insert a string with length
even 30. There is no character truncatd when retrieved neither.

However, I cannot simulate the case in the MSSQL database manager. When I executed a SQL script to insert, I was simply not allowed to do so.

Any explanation to the sDid anyone encounter same thing before?
Thanks for any hint.

RegardsMy first thought is that you may not be looking in the right place for something (either the column size or the data entered). You are right that normally trying to put 30 characters in a 20 character slot will result in an error. Does the VB script have "on error resume next"? Can you disect the VB script enough to see the insert statement itself? Post that insert statement and the result of sp_help tablename, if you can.|||Hi,

Thanks for the help. Below is the piece of codes, while t1_id was declared as CHAR(20) NOT NULL but a string with length 30 could be inserted and retrieved.

----------------------
On Error GoTo errors:
Dim conn As RDO.rdoConnection
Set conn = mrdoConnection.Connection

sqlStr = "INSERT INTO t1 (t1_id,t1_name) values ('" & s1 & "', '" & s2 & "')"
conn.Execute sqlStr

errors:
MsgBox err.Description
If Not conn Is Nothing Then
conn.RollbackTrans
conn.Close
End If
----------------------|||Must be using the winzip datatype.

create table test1 (col1 char(20))

insert into test1 values
('123456789012345678901234567890')

Server: Msg 8152, Level 16, State 9, Line 1
String or binary data would be truncated.
The statement has been terminated.

Even if there was something (connection option of some sort) preventing you from getting an error returned, you would not be able to retrieve the value. When you insert the value, what do you get from this?

select * from t1

Here, I am assuming that t1 is some sort of permanent entity that is not being dropped and recreated for every run.