Showing posts with label access. Show all posts
Showing posts with label access. Show all posts

Friday, March 30, 2012

multi table or one big table?

I want to add my site a Hebrew English dictionary, I have a MS Access table with 55,000 words which I want to use.

I wondered if I should divide the table to little ones? (Lets say, to put each letter (a, b, c...) in different table. to check what the first word the user clicked and to get the data from this table. I just thought that 50,000 words is too much for each search, but I wonder if the code that I'll need to make the right table name will take longer?

Does 55000 rows is a big table? Should I worry about it or not?

Thanks...don't worry about it. 55000 rows isn't going to be too big of an issue. Just index the table based on any field you do a where clause on, and you'll be in good shape.|||Would you be interested in sharing your database of Hebrew words?

multi step OLE DB error

Hi All,

I have a MS Access DB that I have successfully u/graded to SQL Express 2005. I run my code using a recordset as normal, and all connections to the database work fine, but I receive the multi step OLE DB error when it gets to a line trying to populate an address field which has a datatype of nvarchar(max), null. (Field was Memo in Access version before).

This field in SQL2005 has allow nulls.

I've tried to add an empty string " " to the variable before being saved, but this still doesn't work.

Any ideas?


Hi,

could you please provide the code you are using as well as the exact error message ?

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

Hi,

The exact error message received is:

-2147217887 - Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

**************************************************************************

The code that is used, (some cut to save space) is below. All is fine, but breaks on the Physical Address line highlighted.

GetDSN gets the DSN in the DSN settings using ODBC. As I said, this worked in Access, but now in SQL, its not working.

**************************************************************************

Public Function mStaffUpdate(StaffID As Long, Title As String, FirstName As String, LastName As String, _
JobTitle As String, Department As String, Phone As String, _
Fax As String, PhoneExt As String, Mobile As String, _
HomePhone As String, Email As String, Website As String, _
CompanyLink As Long, PhysicalAddress As String, _
PhysicalCity As String, PhysicalState As String, PhysicalZipCode As String, _
PhysicalCountry As String, PostalAddress As String, _
PostalCity As String, PostalState As String, _
PostalZipCode As String, PostalCountry As String, _
UserName As String, Password As String, SecurityLevel As String)

' Open a Connection Object to the database
Dim cnnData As ADODB.Connection
Set cnnData = New Connection

cnnData.Open GetDSN

' Open a Recordset Object
Dim rsData As ADODB.Recordset
Set rsData = New ADODB.Recordset
Dim strSQL As String
strSQL = "SELECT * FROM tblStaff WHERE StaffID= " & StaffID
rsData.Open strSQL, cnnData, adOpenStatic, adLockPessimistic

'cut some out for less to see here...
rsData.Fields("HomePhone").Value = HomePhone
rsData.Fields("Email").Value = Email
rsData.Fields("Website").Value = Website
rsData.Fields("PhysicalAddress").Value = PhysicalAddress & " "
rsData.Fields("PhysicalCity").Value = PhysicalCity & " "
rsData.Fields("PhysicalState").Value = PhysicalState & " "

rsData.Update

' Close cnn and recordset
rsData.Close
Set rsData = Nothing
cnnData.Close
Set cnnData = Nothing

End Function

|||any ideas?|||Do you exceed the max possible characters eventually ?

HTH, Jens K. Suessmeyer.

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

No. Actually the address field doesn't need to be that large, it will only have 3-4 lines of an address. But I can't work out why this error is happenning?

|||any suggestions|||

Hi All,

Is there a different group that might be better to help with this question above?

I'm really keen to know what's the cause of this error and how to correct.

|||Moved to Data Access :-)|||can anyone help?|||any ideas?|||

What OLEDB provider are you using?

- Waseem

|||

i have this same problem,

program written in visual basic run properly on access database, but on sql server 2k sp 4 causes errors with

multi step error.

i change provider from mdac to sql native client and now program is running great

and this is only one opportunity to get your program running (i think - updating mdac doesn't help me)

best

|||

mrowek wrote:

i change provider from mdac to sql native client and now program is running great

and this is only one opportunity to get your program running (i think - updating mdac doesn't help me)

yeah, i just check code in vb with SQLOLEDB.1 provider

when it's saves strings to db it generate error

i put trim(cstr(blah blah)) and now it's write correctly to db without multi step error

[; check code and put this same

it should help

|||

My program occurs this error at the line below:

rs.delete <- occurs "multi-step multi step OLE DB error ......."

I spent two days for finding the resolve way....

then.....I insert "rs.AbsolutePosition = rs.AbsolutePosition" before "rs.delete", like:

.....

rs.AbsolutePosition = rs.AbsolutePosition

rs.delete

rs.update

......

and the error is gone............(maybe this is the most strange thing I have ever seen....@.@.)

multi step OLE DB error

Hi All,

I have a MS Access DB that I have successfully u/graded to SQL Express 2005. I run my code using a recordset as normal, and all connections to the database work fine, but I receive the multi step OLE DB error when it gets to a line trying to populate an address field which has a datatype of nvarchar(max), null. (Field was Memo in Access version before).

This field in SQL2005 has allow nulls.

I've tried to add an empty string " " to the variable before being saved, but this still doesn't work.

Any ideas?


Hi,

could you please provide the code you are using as well as the exact error message ?

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

|||

Hi,

The exact error message received is:

-2147217887 - Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

**************************************************************************

The code that is used, (some cut to save space) is below. All is fine, but breaks on the Physical Address line highlighted.

GetDSN gets the DSN in the DSN settings using ODBC. As I said, this worked in Access, but now in SQL, its not working.

**************************************************************************

Public Function mStaffUpdate(StaffID As Long, Title As String, FirstName As String, LastName As String, _
JobTitle As String, Department As String, Phone As String, _
Fax As String, PhoneExt As String, Mobile As String, _
HomePhone As String, Email As String, Website As String, _
CompanyLink As Long, PhysicalAddress As String, _
PhysicalCity As String, PhysicalState As String, PhysicalZipCode As String, _
PhysicalCountry As String, PostalAddress As String, _
PostalCity As String, PostalState As String, _
PostalZipCode As String, PostalCountry As String, _
UserName As String, Password As String, SecurityLevel As String)

' Open a Connection Object to the database
Dim cnnData As ADODB.Connection
Set cnnData = New Connection

cnnData.Open GetDSN

' Open a Recordset Object
Dim rsData As ADODB.Recordset
Set rsData = New ADODB.Recordset
Dim strSQL As String
strSQL = "SELECT * FROM tblStaff WHERE StaffID= " & StaffID
rsData.Open strSQL, cnnData, adOpenStatic, adLockPessimistic

'cut some out for less to see here...
rsData.Fields("HomePhone").Value = HomePhone
rsData.Fields("Email").Value = Email
rsData.Fields("Website").Value = Website
rsData.Fields("PhysicalAddress").Value = PhysicalAddress & " "
rsData.Fields("PhysicalCity").Value = PhysicalCity & " "
rsData.Fields("PhysicalState").Value = PhysicalState & " "

rsData.Update

' Close cnn and recordset
rsData.Close
Set rsData = Nothing
cnnData.Close
Set cnnData = Nothing

End Function

|||any ideas?|||Do you exceed the max possible characters eventually ?

HTH, Jens K. Suessmeyer.

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

No. Actually the address field doesn't need to be that large, it will only have 3-4 lines of an address. But I can't work out why this error is happenning?

|||any suggestions|||

Hi All,

Is there a different group that might be better to help with this question above?

I'm really keen to know what's the cause of this error and how to correct.

|||Moved to Data Access :-)|||can anyone help?|||any ideas?|||

What OLEDB provider are you using?

- Waseem

|||

i have this same problem,

program written in visual basic run properly on access database, but on sql server 2k sp 4 causes errors with

multi step error.

i change provider from mdac to sql native client and now program is running great

and this is only one opportunity to get your program running (i think - updating mdac doesn't help me)

best

|||

mrowek wrote:

i change provider from mdac to sql native client and now program is running great

and this is only one opportunity to get your program running (i think - updating mdac doesn't help me)

yeah, i just check code in vb with SQLOLEDB.1 provider

when it's saves strings to db it generate error

i put trim(cstr(blah blah)) and now it's write correctly to db without multi step error

[; check code and put this same

it should help

|||

My program occurs this error at the line below:

rs.delete <- occurs "multi-step multi step OLE DB error ......."

I spent two days for finding the resolve way....

then.....I insert "rs.AbsolutePosition = rs.AbsolutePosition" before "rs.delete", like:

.....

rs.AbsolutePosition = rs.AbsolutePosition

rs.delete

rs.update

......

and the error is gone............(maybe this is the most strange thing I have ever seen....@.@.)

Friday, March 23, 2012

Multi access in SQL Server

Hello,

I am working on an Access VBA application, working in client/server
mode, with a shared SQL Server base.

I have to INSERT some data in the base, and the know what is the ID
that SQL Server associated with my data in the table. So I need to do
the following

INSERT data INTO TABLE
SELECT MAX ID FROM TABLE (to get the ID)

but since I am working in client/server, if some DATA has been inserted
by another client after my INSERT, then MAX ID is not the convenient
ID of my data ...

Is there a way for me to get the ID when I do the INSERT, or to
lock/unlock the table before the INSERT and after the SELECT ?

Thank you for any hint about that.

--
L'ordinateur peut faire plus de calculs que le cerveau de l'homme car
il n'a que a faireByB (email@.email.com) writes:

Quote:

Originally Posted by

I am working on an Access VBA application, working in client/server
mode, with a shared SQL Server base.
>
I have to INSERT some data in the base, and the know what is the ID
that SQL Server associated with my data in the table. So I need to do
the following
>
INSERT data INTO TABLE
SELECT MAX ID FROM TABLE (to get the ID)
>
but since I am working in client/server, if some DATA has been inserted
by another client after my INSERT, then MAX ID is not the convenient
ID of my data ...
>
Is there a way for me to get the ID when I do the INSERT, or to
lock/unlock the table before the INSERT and after the SELECT ?


It sounds like your table has the IDENTITY property. In such case, use
the function scope_identity() to retrieve last generated ID value.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Mulitple Select Statements in One Query

I'm trying to make a query in Access that will search for events in a single month where the events all have different names. I have SELECT Count(*) AS EVENT1 in September FROM blah WHERE Date LIKE Sep and EVENT LIKE 1 and then I have another SELECT COUNT statement for event2 in sept with event2 being the heading for the column and it aparently doesn't like that. I'm sorry, but I'm really new to this so I don't know if I'm explaining my problem correctly.SELECT Event, COUNT(*)
FROM myTable99
WHERE EventDat >= '9/1/2003' AND EventDate < '10/1/2003'
GROUP BY Event

?|||could you show some sample rows of the table, and then some sample result rows that you expect to get

rudy|||number date type
224433 sep fha
224432 sep fha
224424 sep fnma
234443 oct fha

I want it to run the query on September and if type = fha count those and if type = fnma count those so I would want it to return

FHA in Sep FNMA in Sep
2 1

And then I'll run a separate query on Oct with the same types in the headings|||sorry it didn't post correctly that should be a 2 under FHA in sep and a 1 under the FNMA in Sep|||please tell me you did not name your column "date" :eek:
select sum(case when type='fha'
then 1 else 0 end) as "FHA in Sep"
, sum(case when type='fnma'
then 1 else 0 end) as "FNMA in Sep"
from yourtable
where [date] = 'sep'

rudy
http://r937.com/|||Thanks for the advice and yes I labeled my column Date, it was lock_effective_date, but I didn't feel like typing that a bunch of times. So what is the problem with that? Too general?|||reserved word, will cause syntax errors if you aren't careful|||What happens when you get more than those [types]?

And if you don't like type (good for you), better get used to [brackets]|||I have about 20 different types. I've got them labeled as ProgramName right now. And I'll change "date" to something else.

What do the brackets do? Set it apart as being a field name and not some special modifier or something?|||exactamundo|||I hate to ask y'all to spoon feed me, but I tried that code and it didn't work and this really isn't my forte.

SELECT SUM(case when ProductName LIKE 'FHA30*'
then 1 else 0 end) as "FHA in Sep"
, sum(case when ProductName LIKE 'FNMA30*'
then 1 else 0 end) as "FNMA in Sep"
FROM Calculations2
WHERE LockDate LIKE '*Sep*';

It threw a syntax error.|||As close as I can get:

USE Northwind
GO

CREATE TABLE myTable99 ([number] int, [date] char(3), [type] varchar(5))
GO

INSERT INTO myTable99 ([number], [date], [type])
SELECT 224433, 'sep', 'fha' UNION ALL
SELECT 224432, 'sep', 'fha' UNION ALL
SELECT 224424, 'sep', 'fnma' UNION ALL
SELECT 234443, 'oct', 'fha'
GO

SELECT [type] + ': ' +CONVERT(varchar(10), COUNT(*)) AS Denorm INTO #bk_Temp
FROM myTable99
WHERE [date] = 'sep'
GROUP BY type

DECLARE @.Result varchar(8000)

SELECT @.Result = ''
SELECT @.Result = @.Result + Denorm + ' ' FROM #bk_Temp

SELECT RTRIM(@.Result)
GO

DROP TABLE myTable99
GO
DROP TABLE #bk_Temp
GO|||I'm sorry, but that's totally past my understanding. I've already got the table in there I was just trying to make heads and tails of the code that r937 supplied for the if-then statement in the SUM section:

select sum(case when type='fha'
then 1 else 0 end) as "FHA in Sep"
, sum(case when type='fnma'
then 1 else 0 end) as "FNMA in Sep"

The syntax error it throws is a missing operator in the statement:
SUM(case when ProductName LIKE 'FHA30*'
then 1 else 0 end)

I think the rest of it is okay.|||Originally posted by poontz13
I'm sorry, but that's totally past my understanding.

My sample is cut and paste-able, and should run in QA with no problem..

check it out...

You're problem though, is everytime you get a new type, you'll be hosed..|||your use of asterisks as wildcards is consistent with microsoft access, not sql server

if it's actually access, then shame on you for posting an access question in the sql server forum without mentioning it

this would explain why the CASE structure throws an error

in access you have to use IIF

rudy|||I'm sure you're getting frustrated with me Brett, but again, I'm really not too good at coding; to my understanding, your code looks like it is creating a table and then picking the number, date and type and putting them in there. I have a table with about 450 entries where the number is the primary key and I just want it to search through the table and count the number of items with a specific productName that occurs in a given month. I tried the following code, but it returned the number 72 which is the total number of items in September:

SELECT COUNT(ProductName LIKE 'FHA30*') AS ["FHA in Sep"],
COUNT(ProductName LIKE 'FNMA30*') AS ["FNMA in Sep"]
FROM Calculations2
WHERE LockDate LIKE '*Sep*';

So obviously my count isn't specifying the productName correctly and it is just couting all items.

Any other advice? I do appreciate it.|||AW, CRAP

my bad

sincere apologies

yes, you did mention access

hang on a sec and i'll rewrite the query for ya...

rudy|||I'm sorry! Yes it's access, I'm new to the forum and I guess I didn't see the Access forum...so, I need to use:

SELECT SUM(IIF ProductName LIKE 'FHA30*'
then 1 else 0 end) as "FHA in Sep"
, sum(IIF ProductName LIKE 'FNMA30*'
then 1 else 0 end) as "FNMA in Sep"
FROM Calculations2
WHERE LockDate LIKE '*Sep*';|||SELECT SUM(IIF(ProductName LIKE 'FHA30*',1,0)) AS "FHA in Sep"
, SUM(IIF(ProductName LIKE 'FNMA30*',1,0)) AS "FNMA in Sep"
FROM Calculations2
WHERE LockDate LIKE '*Sep*'|||That worked! (Not that I doubted it would once I phrased it right to y'all) I truly appreciate it, this will help me out a lot.|||great

once again, i apologize for chiding you, when in fact you did mention access right in your first sentence

rudy|||No problem...you're just trying to help me.

I do have one other question.

Instead of hard coding different queries for each month...can I prompt the user when they click on the query to type in the month they want to find?|||yes

is LockDate an actual date/time field?

SELECT [enter month 1 - 12] as "month"
, SUM(IIF(ProductName LIKE 'FHA30*',1,0)) AS "FHA"
, SUM(IIF(ProductName LIKE 'FNMA30*',1,0)) AS "FNMA"
FROM Calculations2
WHERE month(LockDate) = [enter month 1 - 12]|||Originally posted by r937
yes

is LockDate an actual date/time field?

SELECT [enter month 1 - 12] as "month"
, SUM(IIF(ProductName LIKE 'FHA30*',1,0)) AS "FHA"
, SUM(IIF(ProductName LIKE 'FNMA30*',1,0)) AS "FNMA"
FROM Calculations2
WHERE month(LockDate) = [enter month 1 - 12]

Okay, I understand your code, right now it's set up as 01-Sep-03. I left it as text when I imported it from excel to access just for uniformity sake. So if I prompt the user to enter 1-12, I guess I'll have to define somewhere that 1 = Jan, 2 = Feb, ... or whatever my date column has as the abreviation for the month? If so where do I put the declaration.|||Access...ok now I understand the confusion...

I was going to give you this

USE Northwind
GO

CREATE TABLE myTable99 ([number] int, [date] char(3), [type] varchar(5))
GO

INSERT INTO myTable99 ([number], [date], [type])
SELECT 224433, 'sep', 'fha' UNION ALL
SELECT 224432, 'sep', 'fha' UNION ALL
SELECT 224424, 'sep', 'fnma' UNION ALL
SELECT 234443, 'oct', 'fha'
GO

DECLARE @.SQL varchar(2000), @.Select varchar(1000)
SELECT @.SQL = ' SELECT ', @.Select = ''
SELECT @.Select = @.Select + 'SUM(CASE WHEN [type] = ' + '''' + [Type] + '''' + ' THEN 1 ELSE 0 END) AS ' + [Type]+','
FROM (SELECT DISTINCT [type] FROM myTable99 WHERE [date] = 'sep') AS A
SELECT @.Select = SUBSTRING(@.Select,1,LEN(@.Select)-1)
SELECT @.SQL = @.SQL + @.Select
SELECT @.SQL = @.SQL + ' FROM myTable99 WHERE [date] = ' + '''' + 'sep' + ''''
SELECT @.SQL
EXEC(@.SQL)

DROP TABLE myTable99
GO

But since you don't have QA, it's useless...

What it does though is what you want..it's dynamic sql and build a select based on data in your table...

I've done stuff in Access.(sortof) using the make query function...

But it's been a loooooong time...|||I got ya...thanks for trying to help though, so now I guess you can see why I was extremely confused. I sort of understood what your code was saying, but got lost in there somewhere. Thanks again.|||you will get lots more mileage, and simpler queries, if you convert your column from text to datetime

meanwhile, try this --

... where LockDate like '*' + [enter month xxx] + '*'

and don't forget to change it in the SELECT as well

rudy|||Originally posted by r937
you will get lots more mileage, and simpler queries, if you convert your column from text to datetime

meanwhile, try this --

... where LockDate like '*' + [enter month xxx] + '*'

and don't forget to change it in the SELECT as well

rudy

I'll change it to date/time, makes sense, so when the user inputs the month number, what tells access that 4 equates to the 4th month and not the 4th day or 4th year? Also, if I use what you stated above, the user would then have to know that September is Sep right? Like if they typed in Sept then it wouldn't work. Am I right? So again your method for date/time would be better.|||>> what tells access that 4 equates to the 4th month

because the query would be using the MONTH() function on the datetime field|||But again...ALL of this is a presentation layer issue that can probably be more easily handled with code...

You're using Access 2000 and Forms?

AND, if you are, don't you expect that you need n number of controls to accept the results?

Your row length is variable

And if the User type in a wrong date, it'll yell at them...|||Oh I see...in the WHERE statement month() is a function, I thought it was being treated like an object as declared in the SELECT like in JAVA. I'm going to try this...I appreciate it.|||The error now is "The SELECT statement includes a reserved word or an argument name that is mispelled or missing, or the punctuation is incorrect."

Here's my code:

SELECT [enter month 1 - 12] as "Month",
SUM(IIF(ProductName LIKE 'FHA30*',1,0)) AS ["FHA 30 in Sep"],
FROM Calculations2
WHERE month(LockDate) = [enter month 1 - 12];|||SELECT [enter month 1 - 12] as myMonth,
SUM(IIF(ProductName LIKE 'FHA30*',1,0)) AS [FHA 30 in Sep],
FROM Calculations2
WHERE month(LockDate) = [enter month 1 - 12];

Spaces in column names is not a good thing...

EDIT Look at that, the same exact time...

double quote in Access mean data, [] mean columns|||take the square brackets off the alias

... AS "FHA 30 in Sep"|||HECK YEAH!!! It works...thanks soo much. I sure you haven't heard the last from me. Thanks. Rudy...do you have a problem with me emailing you if I have a specific question? If it's general I'll obviously post it to the forum.|||no, no problem, although i have a hard time seeing why it wouldn't be general enough to let others take a crack at it

i mean, look at brett, how eager he was, there are bound to be others, and i may not always be available...

rudy

Wednesday, March 21, 2012

mssqlserverADhelper service terminated, Access Denied when trying to connect

This problem just started recently. This computer connected to the database
when it was first installed. All computer are new Compaq running Windows xp
pro.
This is a problem with MSDE. We are running MS Retail Management system.
One Point of Sale station won't connect to the server. I am running MSDE on
4 computers. One is the peer server it is named "serverxp" the one that
won't connect is "POS2". Other computers are POS1 and notebook. Below is
the case notes so far.
This one POS station is having a problem connection to the server database.
It has no problem connecting to the local database. What I see is on the SQL
Service Manager, When I select the network server "ServerXP" there is
nothing in the dropdown for services. When I select the local server then
three options are listed Dist. Tran, SQL Server and SQL Server agent.
This POS2 computer can connect to ServerXP and see shared folders etc. So I
haven't found any problem with the LAN or hardware.
Can you tell by this description what is wrong or what to try to do to fix
this?
Thanks
----
6/9/2004 1:28:00 PM CDT -- Allison Haaland
Steven,
I have a few more questions for you in order to further troubleshoot this
issue:
1. When you look at the SQL Server Service Manager and choose the "ServerXP"
option, does it say Not Connected at the bottom? yes
2. When you select the local server option in SQL Server Service Manager,
can you then connect to the database in Administrator? (You would choose
local as your server in Administrator as well.) yes
3. If you go to Start | Control | Administrative Tools | Services, do you
see your MSSQL and SQLAgent options there? If so, is the Status showing as
'Started'? If not, you should make sure that the Services are started if
you're trying to use them.
.MSSQLServer is started
MSSQLServerADhelper is set to manual and will not start "could not start
access denied"
4. Is there anything else that is different about this workstation from the
others? This might help us find out why it is not working, but all of the
others are. no
Thanks,
Allison
----
6/9/2004 3:51:00 PM CDT -- Steven
Allison:
More Info. An error in the System error log shows.
The mssqlserverADhelper service terminated with service specific error
3221225572 error 2270 refer to Knowledge base 314094. ID 7024
this is talking about the computer name. The name of this PC is POS2 it is
unique on this network.
----
6/9/2004 4:43:00 PM CDT -- Allison Haaland
Steven,
It looks like the error you are running into now is a network related issue
related to your computer name. I see that you have already referenced
Knowledge base article #314094 - have you tried the steps that it gives to
resolve this error? YES.
POS2 was working correctly at the time it was installed. No name have been
changed.
Can anyone with more experience working with SQL server give me some help
correcting this problem? Thank you.Hi Steve,
What error is generated with the connection fails?
Create an ODBC Test DSN and post the entire message here.
The ADHelper servers is not required for machines to connect to one
another. It's used to publish objects to Active Directory.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

mssqlserverADhelper service terminated, Access Denied when trying to connect

This problem just started recently. This computer connected to the database
when it was first installed. All computer are new Compaq running Windows xp
pro.
This is a problem with MSDE. We are running MS Retail Management system.
One Point of Sale station won't connect to the server. I am running MSDE on
4 computers. One is the peer server it is named "serverxp" the one that
won't connect is "POS2". Other computers are POS1 and notebook. Below is
the case notes so far.
This one POS station is having a problem connection to the server database.
It has no problem connecting to the local database. What I see is on the SQL
Service Manager, When I select the network server "ServerXP" there is
nothing in the dropdown for services. When I select the local server then
three options are listed Dist. Tran, SQL Server and SQL Server agent.
This POS2 computer can connect to ServerXP and see shared folders etc. So I
haven't found any problem with the LAN or hardware.
Can you tell by this description what is wrong or what to try to do to fix
this?
Thanks
6/9/2004 1:28:00 PM CDT -- Allison Haaland
Steven,
I have a few more questions for you in order to further troubleshoot this
issue:
1. When you look at the SQL Server Service Manager and choose the "ServerXP"
option, does it say Not Connected at the bottom? yes
2. When you select the local server option in SQL Server Service Manager,
can you then connect to the database in Administrator? (You would choose
local as your server in Administrator as well.) yes
3. If you go to Start | Control | Administrative Tools | Services, do you
see your MSSQL and SQLAgent options there? If so, is the Status showing as
'Started'? If not, you should make sure that the Services are started if
you're trying to use them.
..MSSQLServer is started
MSSQLServerADhelper is set to manual and will not start "could not start
access denied"
4. Is there anything else that is different about this workstation from the
others? This might help us find out why it is not working, but all of the
others are. no
Thanks,
Allison
6/9/2004 3:51:00 PM CDT -- Steven
Allison:
More Info. An error in the System error log shows.
The mssqlserverADhelper service terminated with service specific error
3221225572 error 2270 refer to Knowledge base 314094. ID 7024
this is talking about the computer name. The name of this PC is POS2 it is
unique on this network.
6/9/2004 4:43:00 PM CDT -- Allison Haaland
Steven,
It looks like the error you are running into now is a network related issue
related to your computer name. I see that you have already referenced
Knowledge base article #314094 - have you tried the steps that it gives to
resolve this error? YES.
POS2 was working correctly at the time it was installed. No name have been
changed.
Can anyone with more experience working with SQL server give me some help
correcting this problem? Thank you.
Hi Steve,
What error is generated with the connection fails?
Create an ODBC Test DSN and post the entire message here.
The ADHelper servers is not required for machines to connect to one
another. It's used to publish objects to Active Directory.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.

Wednesday, March 7, 2012

MSSQL2000 jdbc driver on UNIX ...

Hi experts,
I am new in java programming. I am wana to develop an application program
which can access MSSQL2000 under UNIX platform. I downloaded the jdbc
drivers for MSSQL2000 on Microsoft download center (Windows version & UNIX
version). I installed and set up on my machines,Windows 98 and
HPUX,respectively. And then, I do a sample code and try to accesss
MSSQL2000. It is works on Windows platform. But unfortunately, it does work
very well on my UNIX machine, and have an exception as
"com.microsoft.jdbc.sqlserver.SQLServerDriver".(co mplie pass). I have been
trying many times and can not get rid of this problem. Anyone can give me an
idea to solve it ? Thank you.
F.Y.I:
OS : HPUX10.20
JDK : 1.1.8
The configurlation in .cshrc :
...
set mypath = ( ... )
set hp93kpath = ( ... )
set javapath = ( ... )
set path = ($mypath $hp93kpath $javapath)
setenv classpath
install_dir/lib/msbase.jar:install_dir/lib/msutil.jar:install_dir/lib/mssqls
erver.jar
My sample code ..
import java.io.*;
import java.sql.*;
public class TestDB{
public static void main(String[] args){
try{
String mySQL = "select * from ABC";
Class.forname("com.microsoft.jdbc.sqlserver.SQLSer verDriver");
Connection cn =
DrvierManager.getConnection("jdbc:microsoft:sqlser ver://server_name:1433:Dat
abaseName = AAA","guest","guest");
Statement st = cn.createStatement();
resultSet rs = st.executeQuery(mySQL);
:
:
}catch(Exception e){
}finally{
rs.close();
st.clsoe();
cn.close();
}
}
}
Possibly a classpath problem. Do you see the jar's when you do:
shall> set | grep CLASSPATH
Or you could set the jar-CLASSPATH temporarely when you compile and run with
the 'env' shell statement, or on the javac/java command line.
Lars-Inge Tnnessen
www.larsinge.com

mssql: insert into syntax

Hello
Can anyone help me translate this from access so that it can work in mssql
(i need to get next value, but cannot use identity as if row is deleted,
another must get new next column number which would be same as deleted one)
Access;
INSERT INTO table
SELECT
(IIF(code<>Null,MAX(code)+1,1) AS code,
0 AS usercode
FROM table

I tried this in mssql but will not work:
INSERT INTO table
SELECT
CASE
WHEN code IS NULL THEN 1
ELSE MAX(code)+1
END
AS code,
0 AS usercode
FROM tableHi

You may be better of using an identity column. It is not guaranteed to be
contiguous but usually is the ordinal value that is required. This is
similar to the autoincrementing number in access. See the topic "Identity
(Property)" in books online for more information.

John

"Andre" <spam@.spam.com> wrote in message news:de9g0c$ih4$1@.ss405.t-com.hr...
> Hello
> Can anyone help me translate this from access so that it can work in mssql
> (i need to get next value, but cannot use identity as if row is deleted,
> another must get new next column number which would be same as deleted
> one)
> Access;
> INSERT INTO table
> SELECT
> (IIF(code<>Null,MAX(code)+1,1) AS code,
> 0 AS usercode
> FROM table
> I tried this in mssql but will not work:
> INSERT INTO table
> SELECT
> CASE
> WHEN code IS NULL THEN 1
> ELSE MAX(code)+1
> END
> AS code,
> 0 AS usercode
> FROM table|||On Sun, 21 Aug 2005 11:02:42 +0200, Andre wrote:

(snip)
>Access;
>INSERT INTO table
>SELECT
> (IIF(code<>Null,MAX(code)+1,1) AS code,
>0 AS usercode
>FROM table

Hi Andre,

As John says: Consider using IDENTITY (the SQL Server equivalent of what
Access calls "autonumber").

If there are reason's why you can't use IDENTITY, then use

SELECT COALESCE(MAX(code), 0) + 1 AS code
FROM table

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||will try this
thx

(by the way, i mentioned I cannot use identity as it would not preserve
correct order if a middle row is deleted
and it would not allow end-user to change it)
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:6fqgg1d3f7bpim4ct0bril93j6vkedhgek@.4ax.com...
> On Sun, 21 Aug 2005 11:02:42 +0200, Andre wrote:

> If there are reason's why you can't use IDENTITY, then use
> SELECT COALESCE(MAX(code), 0) + 1 AS code
> FROM table|||On Sun, 21 Aug 2005 14:19:39 +0200, Andre wrote:

>will try this
>thx
>(by the way, i mentioned I cannot use identity as it would not preserve
>correct order if a middle row is deleted
>and it would not allow end-user to change it)

Hi Andre,

That's a logical result of the "raison d'etre" of the IDENTITY
attribute. You should use IDENTITY only to generate a unique numeric
value that can be used in place of the "real" key in foreign key
relationships. For instance, if a Foo is identified by the combination
of FooName, FooDate and FooWeight, the tables Foo and Bar *could* look
like this:

CREATE TABLE Foo
(FooName varchar(35) NOT NULL,
FooDate datetime NOT NULL,
FooWeight numeric (15,7) NOT NULL,
-- other columns,
PRIMARY KEY (FooName, FooDate, FooWeight)
)
CREATE TABLE Bar
(BarNo int NOT NULL,
FooName varchar(35) NOT NULL,
FooDate datetime NOT NULL,
FooWeight numeric (15,7) NOT NULL,
-- other columns,
PRIMARY KEY (BarNo),
FOREIGN KEY (FooName, FooDate, FooWeight)
REFERENCES Foo (FooName, FooDate, FooWeight)
ON UPDATE CASCADE
ON DELETE NO ACTION
)

Or, you could use IDENTITY to create a surrogate key and have your
tables like this:

CREATE TABLE Foo
(FooID int NOT NULL IDENTITY,
FooName varchar(35) NOT NULL,
FooDate datetime NOT NULL,
FooWeight numeric (15,7) NOT NULL,
-- other columns,
PRIMARY KEY (FooID),
UNIQUE (FooName, FooDate, FooWeight)
)
CREATE TABLE Bar
(BarNo int NOT NULL,
FooID int NOT NULL IDENTITY,
-- other columns,
PRIMARY KEY (BarNo),
FOREIGN KEY (FooID) REFERENCES Foo (FooID)
ON DELETE NO ACTION
)

This gives Bar a smaller footprint, and will speed up te joins (but at
the expense of a higher number of required joins). Note that a Foo is
still identified by it's "real" key. Also note that you might just as
well keep the "real" key as PRIMARY KEY and declare the identity column
to be UNIQUE (that will affect how your indexes look, so this is a
choice that affects performance).

An important issue to keep in mind is that the end user never sees the
identity value in this case. The end user will only see the "real" key,
as determined when investigating the business' information needs.

Your mention of preserving order when rows are deleted makes me think
that you want to use IDENTITY to get a ranking. In that case: don't. The
only thing MS guarantees about IDENITY is that it will be a unique value
in it's table (proivided you never override the generated values or
reset the seed). If you need a rank, you can either:
a) Compute it whenever you query the data. Use a view if you don't want
to retype the same query logic over and over again, or
b) Compute and store it; recompute ranks after each modification; this
one is dangerous (one uncontrolled modification can ruin the scheme) and
can slow down modification operations - only use it if you query the
data (including the rank) much more often than you modify the data.

Your mention of end users changing the value makes me think that you
don't want a ranking after all - but if have no idea what you do want to
use it for. Can you explain the purpose of this? I'm asking partly out
of curiosity, partly because I have the feeling that you're about to
make an error that either you or your successor will regret - I might be
wrong (I hope so!), but if I'm not, you better change your plan now,
before it is too late!

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||I have an accounting program which I am moving to mssql.
Now, I have tables which contain various documents (bills, inputs/outputs
etc).
Each document in its group must be in order
1,2,3...
there can be no omissions.
Now, I must permit to some users to delete documents (if these have been
entered by mistake), but also to permit
them to change their numbers. But these numbers must be unique in their
respective tables.
And, when user is creating new document, program must give him next number
(serial number if you wish).

So, since user might delete a middle row, using identity would mean that he
could, later when he creates document, give it the
number he previously deleted. I could set identity to allow change, but I
don't want to.

My programs currently run on access and mysql. I am adding mssql but didn't
expect so much trouble with sql syntax
Coalesce was mentioned in previous post: it does not work
I need simple

INSERT INTO table SELECT ISNULL(MAX(fieldvalue)+1,1) AS fieldvalue FROM
table
or
INSERT INTO table SELECT MAX(fieldvalue)+1 AS fieldvalueFROM table

if this is not possible on mssql, I will have to create on insert trigger or
lock table while creating new entry and first get value, then insert it into
table (1 query, 1 insert - lock, since two users might at the same time
create new: while information fieldvalue+1 travels to first user, second
executes same query and gets same
number as first has not made insert yet)|||Hugo Kornelis (hugo@.pe_NO_rFact.in_SPAM_fo) writes:
> Your mention of preserving order when rows are deleted makes me think
> that you want to use IDENTITY to get a ranking. In that case: don't. The
> only thing MS guarantees about IDENITY is that it will be a unique value

Eh, Andr says he does not want to use IDENTITY, so you tell him not to
use it?

Anyway, if you say:

INSERT tbl (...)
SELECT ...
ORDER BY ...

and tbl has an IDENTITY column, the message I have, is indeed that there
is a guarantee that the IDENTITY values will reflect the ORDER BY clause.

However, this does not apply to SELECT INTO.

In any case, it is obvious from Andre's description of his business problem
that he should stay away from IDENTITY.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Andre (spam@.spam.com) writes:
> Coalesce was mentioned in previous post: it does not work

Please defined "does not work". Do you get an error message, do you
get unexpected result, does heaven fall down on your or what?

In any case, this seem to work:

CREATE TABLE andre (id int NOT NULL PRIMARY KEY,
somedata varchar(230) NOT NULL)
go
INSERT andre (id, somedata)
SELECT coalesce(MAX(id), 0) + 1, 'This is some data'
FROM andre
INSERT andre (id, somedata)
SELECT coalesce(MAX(id), 0) + 1, 'This is some other data'
FROM andre
INSERT andre (id, somedata)
SELECT coalesce(MAX(id), 0) + 1, 'This is any data'
FROM andre
go
SELECT * FROM andre ORDER BY id
go
DROP TABLE andre

> I need simple
> INSERT INTO table SELECT ISNULL(MAX(fieldvalue)+1,1) AS fieldvalue FROM

Since isnull() is proprietary to SQL Server, while coalesce() is
ANSI-SQL and you support other DBMS's, coalesce() would be a better
choice.

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

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

You can try it as

INSERT INTO table
SELECT ISNULL(MAX(code),0)+1, 0 FROM table

Please let me know if u have any questions

best Regards,
Chandra
http://www.SQLResource.com/
http://chanduas.blogspot.com/
------------

*** Sent via Developersdex http://www.developersdex.com ***|||Hi Andre

>From your description it sounds like you have to re-order everything if
you remove an intermediate document. This will not lead to a very
scalable application.

John|||Thank you all for help.

Problem was somewhere else:

I tried
INSERT INTO table x AS fieldx, y AS fieldy FROM table
while correct (for MSSQL obviously) is:
INSERT table (fieldx,fieldy) SELECT x,y FROM table

again, thank you for your time

p.s.: I wonder why are there such differences between sql syntax for various
databases (as in: what is the point of standard which is ignored)|||Andre (spam@.spam.com) writes:
> Thank you all for help.
> Problem was somewhere else:
> I tried
> INSERT INTO table x AS fieldx, y AS fieldy FROM table
> while correct (for MSSQL obviously) is:
> INSERT table (fieldx,fieldy) SELECT x,y FROM table

As far as I know the latter is also compliant with ANSI standards.
(Save for the fact that ANSI mandates INTO, while this is optional in
MS SQL Server.) The first syntax is something I've never seen before.
Does it work anywhere?

> p.s.: I wonder why are there such differences between sql syntax for
> various databases (as in: what is the point of standard which is
> ignored)

Indeed, just because it is the standard, does not mean that it is
implemnented everywhere. However, the basics of a regular INSERT
statement is something I would expect to work everywhere.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||On Sun, 21 Aug 2005 23:34:40 +0200, Andre wrote:

>I have an accounting program which I am moving to mssql.
>Now, I have tables which contain various documents (bills, inputs/outputs
>etc).
>Each document in its group must be in order
>1,2,3...
>there can be no omissions.
>Now, I must permit to some users to delete documents (if these have been
>entered by mistake), but also to permit
>them to change their numbers. But these numbers must be unique in their
>respective tables.
>And, when user is creating new document, program must give him next number
>(serial number if you wish).
(snip)

Hi Andre,

There are some conflicting requirements. If there may be no omissions,
than you must either not allow users to delete a document (or rather:
don't allow them to delete A ROW - if the corresponding document is
deleted, keep the row but set a column to indicate that the document is
deleted) - or you must renumber all documents each time a document is
deleted to make sure that there never are gaps. Of course, if these
numbers are visible to the user and used to identify the documents, then
renumbering them will wreak havoc to the ability to relate rows in the
database to the actual documents. And if the users don't see the
numbers, then why bother with trying to keep them without omissions?

Also, if you allow users to change the document number, you are actually
guaranteed to get omissions. Sooner or later, someone will type the
number 42 because he's a Douglas Adams fan.

If the actual requirement is to use a number that is PREFERABLY
increasing and without gaps, and that users can optionally change to
reuse the number of a deleted document, I'd say: do a SELECT MAX(..)
query in the front end; increase by one and prepopulate the number field
in your frontend with that number. The user can either accept this
default or type a different number. The number that is in the field when
the user submits his data entry is sent to the database in an INSERT ...
VALUES statement.

(snip)
>I could set identity to allow change, but I
>don't want to.

So instead, you try to create your own solution that behaves exactly as
IDENTITY after setting it to allow change, but less scalable?

(snip)
>Coalesce was mentioned in previous post: it does not work
>I need simple
>INSERT INTO table SELECT ISNULL(MAX(fieldvalue)+1,1) AS fieldvalue FROM
>table

This should work. If you replace ISNULL with COALESCE, it should still
work. If it doesn't then please provide more information.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||Actually, it is only important to fetch new table entry as CODE+1
Gaps are OK if user makes them. Skipping order number of CODE by user is
also OK.
But program must always return CODE+1 when new row is added.
User may change the number to any he wishes (except existing one) and the
next new row will be +1
This, of course, is not my idea. I would forbid deleting documents (even law
requires them to be void, not deleted - we are talking about accounting
program)
but then nobody would purchase my program.

"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:ipfkg118so3erd23b2sqa65kcsbosi585f@.4ax.com...
> On Sun, 21 Aug 2005 23:34:40 +0200, Andre wrote:
> There are some conflicting requirements. If there may be no omissions,
> than you must either not allow users to delete a document (or rather:
> don't allow them to delete A ROW - if the corresponding document is
> deleted, keep the row but set a column to indicate that the document is
> deleted) - or you must renumber all documents each time a document is
> deleted to make sure that there never are gaps. Of course, if these
> numbers are visible to the user and used to identify the documents, then
> renumbering them will wreak havoc to the ability to relate rows in the
> database to the actual documents. And if the users don't see the
> numbers, then why bother with trying to keep them without omissions?
> Also, if you allow users to change the document number, you are actually
> guaranteed to get omissions. Sooner or later, someone will type the
> number 42 because he's a Douglas Adams fan.
> If the actual requirement is to use a number that is PREFERABLY
> increasing and without gaps, and that users can optionally change to
> reuse the number of a deleted document, I'd say: do a SELECT MAX(..)
> query in the front end; increase by one and prepopulate the number field
> in your frontend with that number. The user can either accept this
> default or type a different number. The number that is in the field when
> the user submits his data entry is sent to the database in an INSERT ...
> VALUES statement.|||On Tue, 23 Aug 2005 13:28:57 +0200, Andre wrote:

>Actually, it is only important to fetch new table entry as CODE+1
>Gaps are OK if user makes them. Skipping order number of CODE by user is
>also OK.
>But program must always return CODE+1 when new row is added.
>User may change the number to any he wishes (except existing one) and the
>next new row will be +1
>This, of course, is not my idea. I would forbid deleting documents (even law
>requires them to be void, not deleted - we are talking about accounting
>program)
>but then nobody would purchase my program.

Hi Andre,

I stick with my previous recommendation.

1. Fetch MAX(code)+1 with a non-locking query when opening the screen.
Either display it as default value in the code field, or keep the code
field blank.

2. When details are entered, attempt to insert the row, with code as
entered on the screen; if no value is entered, use the MAX(code)+1 from
the previous call.

3. If a row with the chosen key value exists, further action is decided
by the front end:

3a. If key was entered by user: error message.
3b. If user didn't override the default, re-insert row with MAX(code)+1
as new code; show warning message that code has been changed.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)

MSSQL, Access 2000, and ODBC Interplay

To date I've used nothing but MySQL and have loved it.
The company I work for uses MSSQL and Access for their
product database. Here is the situation:
Product Manager has created a product database Products.DBF
This file is saved on the same server as the SQL server.
The goal is to have the SQL server use this DBF file so
that she can update the DB via access.
More info: The purpose of this is such that, when people
visit a certain ASP page, that page queries the SQL server
and pulls the data from the DBF file. I'm assuming this
has to be done via ODBC some how, with which I have some
experience, and I'm sure I'm missing something obvious but
any help would be greatly appreciated."Philip" <phil@.fizur.net> wrote in message news:<021101c33f43$fefd55c0$a501280a@.phx.gbl>...
<<>>
> More info: The purpose of this is such that, when people
> visit a certain ASP page, that page queries the SQL server
> and pulls the data from the DBF file. I'm assuming this
> has to be done via ODBC some how, with which I have some
> experience, and I'm sure I'm missing something obvious but
> any help would be greatly appreciated.
Well.. to my mind there is something obvious...
Store the data in sql server.
Forget my mysql.
Or.
Obtain some odbc driver allows access to connect to mysql and forget sql server.

Saturday, February 25, 2012

MS-SQL SQL to Access SQL

I have some SQL that looks like this (see below) it is for MySQL and MS-SQL (so I am told) however I need to impliment the data structure in Access. I have written a VBscript Class that converts and adds all the tables etc but the constraints are not going to work.

My script can strip out the "[dbo]." that access doesn't need but what I need to get any further is to reconstruct this SQL (See below) so that I have SQL that does the same thing in Access.

Once there I can create a few string manipulations to transform it and bingo job done.

I need some help as I am very weak in the ALTER TABLE department.
ALTER TABLE [dbo].[openwiki_macrohelp] ADD
CONSTRAINT [DF__openwiki___macro__7908F585] DEFAULT (1) FOR [macro_builtin],
CONSTRAINT [DF__openwiki___macro__79FD19BE] DEFAULT (0) FOR [macro_numparams],
CONSTRAINT [DF__openwiki___macro__7AF13DF7] DEFAULT ('No description available') FOR [macro_description],
CONSTRAINT [DF__openwiki___macro__7BE56230] DEFAULT ('None') FOR [macro_param1],
CONSTRAINT [DF__openwiki___macro__7CD98669] DEFAULT ('None') FOR [macro_param2],
CONSTRAINT [DF__openwiki___macro__7DCDAAA2] DEFAULT ('None') FOR [macro_param3],
CONSTRAINT [DF__openwiki___macro__7EC1CEDB] DEFAULT ('None') FOR [macro_comment]
GOI can't see why you'd need any code in MS-Access. Just set the default values specified using the MS-Access GUI, and it should handle the rest for you.

While MS-Access doesn't scale well compared to MS-SQL, it certainly is easier to use!

-PatP

Monday, February 20, 2012

MSSQL security - dening applications access to a database

Does any one know of a way to deny access to and application? Not a
user. I am trying to verify something I was told.
Someone told me it was possible to deny accesst to an application I.e.
a user and access the database with MS Query analyser but NOT MS
Access.
Does anyone know if this is possble. I can't find any documentation
that suggests it is.
Thanks in advance
BrianThe closest you can come to that is using Application Roles. More info is
found in Books Online.
Apart from that, you can of course regularly poll the system tables and
execute KILL statements for the connection who comes from not allowed
application names, but that is hardly a clean way of doing it...
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Brian Anderson" <anderb@.iname.com> wrote in message
news:259a9565.0311061242.aeaa352@.posting.google.com...
> Does any one know of a way to deny access to and application? Not a
> user. I am trying to verify something I was told.
> Someone told me it was possible to deny accesst to an application I.e.
> a user and access the database with MS Query analyser but NOT MS
> Access.
> Does anyone know if this is possble. I can't find any documentation
> that suggests it is.
> Thanks in advance
> Brian

MSSQL Remote Access: Can't find solution after 6 hours of searching...

Hello,
I'm trying to access the MSSQl 'remotey'. I open telnet and go to 127.0.0.1 1433 but can't. It seems I have done everything I can to fix it, but nothing solves the problem.

My firewall is disabled.

I have TCP/IP enabled in "SQL Server Configuration Manager" for both Client Protocol and protocols for MSSSQLSERVER (Shared Memory and NAmed Pipes are also both enabled). VIA is disabled.

In SQL Services, SQL Server Integration Services, Full Text Searc, SQL Server, SQL Server Analysis Services, and Server Browser are running. SQL Server Agent is disabled.

In Server Surface Area configuration, under Database Engine is running (automatic) and "Remote Connections" is enabled to TCP/IP and named pipes. Analysis Service has Local and Remote connections checked and is running (automatic). SQL Server agent is stopped.

Integration Services is running (Automatic) SQL Server Browser is running. (Automatic)

When I look in the error log, it shows...

Date 1/4/2007 3:21:45 AM
Log SQL Server (Current - 1/4/2007 3:21:00 AM)

Source Server

Message
Server is listening on [ 127.0.0.1 <ipv4> 1434].

Date 1/4/2007 3:21:45 AM
Log SQL Server (Current - 1/4/2007 3:21:00 AM)

Source Server

Message
Server is listening on [ 'any' <ipv4> 1433].

I have tried to telnet to port 1434 and 1433 but nothing happens. Does anyone know what else I need to be able to access that port?

Thanks
FoleyOh yeah, this is with SQL Server 2005, Windows XP

Thanks.|||

Hi,

On Windows XP Pro you can install Express & Developer Edition ,Refer below KB and links for workaround

http://support.microsoft.com/kb/555585

http://www.teratrax.com/articles/connecting_sql_server_express.html

http://www.datamasker.com/SSE2005_NetworkCfg.htm

http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx

Hemantgiri S. Goswami

MSSQL of MS Access "LAST"

Hi Folks,

I am translating an Access query to SQL but having a hard time!

The LAST function works fine in Access but barfs in MSSQL. Is there an equivalent? Here is a snip of the code that works great in Access:

SELECT DISTINCT Last(Customers.custLastName) AS LAST1, Last(Customers.custFirstName) AS FIRST1, Last(Customers.custAddr1) AS SHIP1, etc etc.

The output just takes the last of a bunch of almost identical entries, ie only one customer per line even though they make many orders.

DISTINCT still seems to grab all of the entries in the db. Do I need to expand on this?

Thanks!try using MIN() instead

rudy|||Hi Rudy,

Thanks for helping with this, but I have a new problem now. If I use the MIN() function, I get one result per name (good) but some fields do not match up (bad). Here's what I mean:

The only way to get a working result is to use this query

SELECT DISTINCT MIN(sfCustomers.custLastName) AS LAST1, MIN(sfCustomers.custFirstName) AS FIRST1, MIN(sfCustomers.custAddr1) AS SHIP1, MIN(sfCustomers.custAddr2) AS SHIP2, MIN(sfCustomers.custCity) AS CITY1, MIN(sfCustomers.custState) AS PROV, MIN(sfCustomers.custZip) AS ZIP1, MIN(sfCustomers.custPhone) AS PHONE, MIN(sfCustomers.custCountry) AS CONTACT1, MIN(sfCustomers.custEmail) AS NOTES, MIN(sfCustomers.custLastName) AS [LAST], MIN(sfCustomers.custFirstName) AS [FIRST], MIN(sfCustomers.custAddr1) AS ADD1, MIN(sfCustomers.custAddr2) AS ADD2, MIN(sfCustomers.custCity) AS CITY, MIN(sfCustomers.custZip) AS ZIP, MIN(sfCustomers.custCountry) AS CONTACT, MIN(sfOrders.orderDate) AS [DATE], MIN(sfOrderDetails.odrdtOrderId) AS IDENT, MIN(sfOrderDetails.odrdtProductID) AS ITEM, MIN(sfOrderDetails.odrdtQuantity) AS Q, MIN(sfProducts.prodName) AS [DESC], MIN(sfProducts.prodPrice) AS PRICE
FROM sfCustomers, sfOrderDetails, sfProducts, sfOrders
WHERE (((sfOrders.orderCustId)=sfCustomers.custID) And ((sfOrderDetails.odrdtOrderId)=sfOrders.OrderID) And ((sfOrderDetails.odrdtProductID)=sfProducts.prodID ))
GROUP BY sfOrders.orderCustId;

However, the fields aren't from the same record! If I use just a MIN() on the first column, I get the error:

[Microsoft][ODBC SQL Server Driver][SQL Server]Column 'sfCustomers.custFirstName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

I'm confused! How do I get just the one record, but with the full info from the one record?

Thanks by the way, I'm really in a bind here!|||start with the GROUP BY

you are grouping by orders, i.e. you will get one row per order

assuming each order belongs to only one customer, you can bring in customer info along with order info and still get one row per order

but what about products ordered? presumably there can be multiple products on an order, so which (single) product did you want to pick? remember, you are asking for only one row per order

rudy

MSSQL ODBC vs. ADO

We have in our applications written in VC++ access also to MSSQL but only over ODBC. Is there any performance difference (is ADO faster) between ODBC and ADO access? And if yes how much it could be ?
Thanks for your answer.Yes, ADO is faster. How much faster depends on a lot of things but the generally accepted figures range from three to ten times faster.

-PatP