|
Hi all
I have data in MS access 97 getting from two deferent sources, I need to compare these data based up on a field called “NAME” Text data type. Here there is a problem i.e. small variation in spelling in the data, what is the best approach to get a list of matched names or partly matched records in both tables.
Regards
shanmuk
|
|
|
|
|
Jawed Akhter
I need Help in the installation of Mysql.
Secondly from where i get free mysql
Thanks
|
|
|
|
|
|
Tell me Which is the free and right version of Mysq
|
|
|
|
|
I learn PHP from "PHP/MySQL Programming for the absolute beginner" (ISBN: 1-931841-32-2). I think it is version 4.2.1 and I use windows 2000. This version of PHP come from the CDROM.
But I think you should find here http://dev.mysql.com/downloads/[^] for the latest version.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
hello.
Can anyone show me how can I do multiple choice searching in a table? I am writing store procedure.
Suppose there are 3 search options on a page.
store procedure searching
@a int,
@b int,
@c int
as
select a,b,c,d,e
from grandtable
where a=@a and/or bhal bhal bhal
I am a very begineer for SQL.
thank,
Sudeep
Some dudes gotta know how to develop a prg. and some dudes just never get it at all.
|
|
|
|
|
My source is a delimited text file containing a date in the form of yyyymmdd. I would like to use the transformation in DTS to convert the data to a datetime column in my destination table. I have been using the import wizard and cannot seem to figure out how to do this. All help is greatly appreciated.
|
|
|
|
|
You should be able to implicitly convert text in that format to a datetime. Just stuff the data into a datetime column, and the the SQL Server handle the conversion automatically.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
When I try to let SQL server handle the conversion I receive this error:
ActiveX Scripting Transform "AxScriptXform' encountered an invalid data value for 'EmpAnnvDate' destination column.
|
|
|
|
|
Have you verified that all of your records contain valid dates in that format?
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
Yes, each record in the text file contains a vaild date. I am testing with a small file that only contains 8 records.
|
|
|
|
|
I'm stumped on how to perform the following:
I want to programmically create two queries, either physically or virtually (doesn't matter), then build an SQL statement that applies both queries into one table. For example
SQL.Format("SELECT * FROM TABLEA")
Create QueryA
SQL.Format("SELECT * FROM TABLEB")
Create QueryB
SQL.Format("SELECT * FROM QueryA JOIN QueryB ON ...");
Open(SQL)
{
parse records
}
I have been given such tips as Stored Procedures but I could get even the simpliest of SP to work in AccessXP. Is such a procedure possible to code in ADOP or will I have to have these queries hard coded in Access?
Thanks!
|
|
|
|
|
You may be looking for the UNION operator. Example:
SELECT
LastName,
FirstName
FROM
CustomerTable
UNION ALL
SELECT
NameLast,
NameFirst
FROM
EmployeeTable
UNION: Returns distinct rows in Access. No duplicate rows.
UNION ALL: Returns all rows in Access. Duplicate rows possible.
|
|
|
|
|
not quite. The queries are already mapped out in Access and i even created a third query that incorporates Query1 and Query2, however I wanted to do this programmically using ADO so instead of using the hard coded queries, I want to programmically make them and apply them as I would in Access. After doing some of my own digging, I think I can achieve this through using the ADOCommand class. Does this sound correct? I noticed a company out there managed to create an active control that can create queries through the ADO control, however I don't know if they can be saved to be used in a further query.
To be more precise, I have mapped out what I need accomplished for an SQL. This as been my whole project and pretty much what all of my previous questions were leading up too. I have a grotesquely complicated query to hash out and I have gotten what I need to work through Access however it took 3 queries: Query1 which grabs all of my Skills and Subskills, Query2 which is a UNION of all custom created SubSkills from all the Customized tables the user created and Query3 is the combination of query1 and query2 joined together. My question now, which should be the final step is figuring out how I can achieve what I have setup in Access through ADO.
Perhaps I have complicated the issue futher than need be but after trying all kinds of different layouts for queries I can't get it to work any other way. If I could somehow make Query1 and Query2 work in the same query then it would solve not having to make two separate queries and join them in a third. Perhaps my database design is faulty but not being an expert, lacking any thorough documentation on SQL and database design it's the best I could come up with and I guess I'll have to live with it and code around it until I can get a better understanding of Database design. In any event, without crying a river here, , does it sound like I'm on the right track?
|
|
|
|
|
I guess I don't follow what you are trying to do. If you have a set of skills which can have many subskills and many custom subskills, it would seem you could just use UNION to join them all together.
It seems that the common table between both queries is the main Skills table. Have both queries join to it and then merge them with a UNION ALL. If you have multiple custom subskills tables, just keep appending more UNIONs. I am not sure why you would want to use a JOIN between Query1 & Query2.
Then again, I probably do not fully understand your problem.
|
|
|
|
|
Hi,
When my app starts, one of the first things it does is go out and look at the database to make sure it is the correct version. If not, it runs the necessary scripts to bring the database version up to the current code version.
The problem is, after I execute the following code to get the database version, when I try to detach the database, I get the error:
"Cannot detach the database 'Training' because it is currently in use."
I have verified that if I skip the code below, the detach works fine. It seems that once I make a connection to the database, there is no way to get rid of it. I tried the dispose method on the connection but even that doesn't do it. Does anyone know how to get ado.net objects to let go of a database?
Dim mConn As SqlClient.SqlConnection
mConn = New SqlClient.SqlConnection(psConnectionString)
Dim sSQL = "SELECT DBVersion FROM CLAwareInfo"
Dim Command As New SqlClient.SqlCommand(sSQL, mConn)
Dim sInstalledDBVersion As String
Command.Connection.Open()
Command.Connection.ChangeDatabase(psDatabase)
Try
sInstalledDBVersion = Command.ExecuteScalar()
Catch ex As Exception
sInstalledDBVersion = ""
Finally
Command.Connection.Close()
End Try
Thanks
David
|
|
|
|
|
You probably also need to Dispose the SqlCommand object.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Try switching the connection to a different database (master) before you close & dispose it.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
Hi,
Thanks for the good ideas above. I tried them and still have the same problem. I created a simple windows form project that reproduces the problem using the Northwind database, and narrows it down to the SqlConnection object. I have a single form with a single button. When the form loads, it creates a connection, opens it, changes the database to master, closes the connection, and disposes the connection object. When the button is clicked, it attempts to detach the database. That raises the error, "Cannot detach the database 'Northwind' because it is currently in use."
I can't figure out what is wrong with this simple code! Any ideas?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'select a single value from a table in the database
Dim mConn As New SqlClient.SqlConnection("data source=(local);initial catalog=Northwind;integrated security=SSPI")
mConn.Open()
mConn.ChangeDatabase("master")
mConn.Close()
mConn.Dispose()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'detach the database
Dim mConn As New SqlClient.SqlConnection("data source=(local);initial catalog=master;integrated security=SSPI")
Dim sSQL = "sp_detach_db 'Northwind'"
Dim Command As New SqlClient.SqlCommand(sSQL, mConn)
Command.Connection.Open()
Try
Command.ExecuteNonQuery()
Catch ex As Exception
Debug.WriteLine(ex.Message)
MsgBox(ex.Message)
Finally
mConn.ChangeDatabase("master")
Command.Connection.Close()
mConn.Dispose()
Command.Dispose()
End Try
End Sub
|
|
|
|
|
Are you on SQL Server, or MSDE? Do you have access to Enterprise Manager?
To figure out where your unwanted connection is coming from, a good starting point is to look at current activity in Enterprise Manager, and see which hosts/applications/logins are connected to the database you're having issues with.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
My app uses MSDE, though I believe SQL Server is installed on my development box. I'm running XP Pro. I'm running on a stand-alone laptop, no other computers connected.
I do have Enterprise Manager, but I've seen Enterprise Manager itself have an open connection to the database that prevents my app from detaching the database, so I generally close it when I'm running my app.
I've used Enterprise Manager some, but am not familiar with how to find out what hosts/applications/logins are connected to my database, as you suggest. I tried by opening local\Management\Current Activity [datetime]\Process Info in EM, and didn't see any reference to the Northwind database when I ran the sample project I posted. Can you point me in the right direction where to look? Or if you have VB.NET and SQL Server, would you mind creating a new Windows Forms project with one button and dropping my sample code in the form, and see if you get the same error when you click the button?
I'm wondering if the problem might have something to do with the way .NET handles memory - maybe the garbage collection isn't happening when I need it to, so even though my objects are not available in code anymore, the connection is somehow still present in memory?
Any suggestions where to look, what to try, or confirmation that my sample code causes the same error on other boxes, would be much appreciated!
Thanks
David
|
|
|
|
|
I send .xls files to a share on a server. I need to take those .xls files and use the data in them to populate a table on that server.
I'm new at this, any details are welcome.
Thanks.
|
|
|
|
|
I'm a bit stumpt.
The application I am working on needs to produce a basic datamodel of the source database, so I am reading the system tables from from the database to determine the data model. However, I cannot seem to find out how to determine the primary key, the following is the test code I have, and from what I can tell from the documentation sysconstraits is supposed to tell me the primary key, but it doesn't seem to work.
BTW, I'm using SQL Server 2000.
SELECT syscolumns.name as column_name, sysconstraints.status as status
FROM syscolumns
INNER JOIN sysobjects on sysobjects.id = syscolumns.id
LEFT OUTER JOIN sysconstraints on
sysobjects.id = sysconstraints.id AND
syscolumns.colid = sysconstraints.colid
WHERE sysobjects.name like 'test_table'
Any ideas would be appreciated.
TIA.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
SELECT COLUMN_NAME, ORDINAL_POSITION
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE TABLE_NAME = 'test_table'
ORDER BY ORDINAL_POSITION
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks for your suggestion.
I had already tried using this view, but it also gives out the foreign keys without distinguishing between them. The constraint name may contain 'PK' in it which could help - but I can't guarantee that some half-crazed database user will keep with that notation.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|