|
I have created an application which uses an access database. All is working fine, when I connect to the database as follows:
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;";<br />
strConnection += " Data Source=E:\\Web_Development\\famtree\\FamilyTree.mdb;";<br />
strConnection +=" user id=; password=;";<br />
conn = new OleDbConnection(strConnection);
However I now want to use odbc dsn, I have set up the DSN for this database with the name 'FamilyTree' therefore I have changed my code to the following:
string strConnection = "DSN=FamilyTree";<br />
strConnection +=" user id=; password=;";<br />
System.Data.Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection(strConnection);
However this gives the following error:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
What is the correct connection string to be used? Am I using the correct class to define the connection?
I'd be grateful for any assistance in setting up this connection to work....
Thanks, Richard
|
|
|
|
|
I believe that you just need the DSN name passed and nothing else. Try that.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Try to check http://www.connectionstrings.com/[^] to solve your problem. Let me know if it is work or not. Good luck
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Thanks, I have tried just DSN=FamilyTree but this acheives the same result... I originally did get the string to use from connectionstrings.com under DNS -> ODBC.
I guess that I am missing some parameters from the connection string, but don't know what they might be. Any more ideas? The alternative is to give up and use a MySQl or MSSQL database, but not sure if this would make any difference.
Richard
|
|
|
|
|
Thanks, I have tried just DSN=FamilyTree but this acheives the same result... I originally did get the string to use from connectionstrings.com under DNS -> ODBC.
I guess that I am missing some parameters from the connection string, but don't know what they might be. Any more ideas? Is there some way of testing that the DSN is set up correctly other than the test I already carried out of viewing a table in excel? The alternative is to give up and use a MySQl or MSSQL database, but not sure if this would make any difference.
Richard
|
|
|
|
|
|
Just a thought....
Since you are building a Calendar/diary program, the database should remain small (~365 entries per year). Since it is small, structures can be parsed at the client with little or no speed issues.
Add a TEXT field to your current sturcture. Fill it with XML.
<ButterFlies>
<ButterFly Type=Monarch Condition=good/>
<ButterFly Type=Moth Condition=poor/>
</BufferFlies>
<WeightLoss>
<FoodEaten Calories=2100/>
<Exercise Task=Running/>
</WeightLoss>
The structures would be easily expanable and upgrades would be simplistic. You will need an XML structure that describes the names & types of what the user wants to collect.
|
|
|
|
|
I am writing a stored procedure, which creates a column using a couple of case statements, it ends up holding an int. Now I need to filter based on that int value, using a variable that is passed into the procedure. I can't seem to do this, because it's not a column in any database. Is there a solution that does not involve temporary tables or a cursor ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Got it. Added an alias for the result set, and therefore able to reference the column.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hello all.
I'm going to use MS Data access (MSDAL) application block in my application.
As I know MSDAL is developed for SQL server only, and my application will work
with SQL server and MSDE as well.
So my question is : does MSDAL work correctly with MSDE, is there performance hit. Some body tested it?
Thanks in advance?
Dima S
|
|
|
|
|
MSDE is in effect SQL Server for workgroups. The same System.Data.SqlClient library objects should work equally well for MSDE as SQL Server.
|
|
|
|
|
Hi
I use SQL Server 2000 + MS search service to add a text search capability to an application.
I use CONTAINS keyword to search and the problem that SQL server raises an error (Execution of a full-text operation failed. A clause of the query contained only ignored words.) When the words entered by user contain noise words like (And-or-also-an-another).
How to make the engine ignores the noise words?
OR:
How to get a complete list of keywords and noise words at runtime to filter them?
Notes:
-noise.dat file does not contain all the invalid characters.
-I can't use FREETEXT instead of CONTAINS because It gets awful result with Arabic language (the major language used in the project)
any comments / suggestions are appreciated and welcomed.
|
|
|
|
|
Hello,
I have a dataTable in my database with columns title, category, problem(description of the problem) and solution. I want to develop a good search mechanism for certain problems so that the user can search for problems – solutions, when he quotes a search term. But I think it is not a good search mechanism when the specific problem with solution is only displayed when the user quotes the correct title of the problem. Is there any other possibility, which is not so difficult to implement?
Regards
mat
|
|
|
|
|
I think I can make it with Full Text Search. Does anbody know how the SQL Query String should look like, when I want to retrieve all titles of the dataTable when the quoted search term occurs in the title or the problem description or the solution?
As said my columns are
Title
Category
Problem
Solution
Regards
|
|
|
|
|
Couldnt find moe suitable board. Pls bear.
MySql connection times out after 8 hrs. Anyone else experienced.
There is no spoon.
mail
|
|
|
|
|
Try to check the information from here[^] and let me know whether it is match what you want or not.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Hye,..what is the datatype for time only.I just want to key in data about time which is 8.00 a.m and so on.
|
|
|
|
|
You should tell us which DBMS that you want to use? In Sql Server the datatype for date and time is datetime . In Ms access you can use Date/Time data type and choose Input mask function from the Field Property place to format your time. If you design an application you should use an activeX control which handle only time input.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
|
How to do the process or read barcode and then convert the data into attributes and save it into table database.(Using Vb 6.0 and MSSQL database server)
|
|
|
|
|
Try to check the information from here[^] and google for more information.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I'd like to do a bulk insert into a table in a Sybase database, similar to the "bulk insert" command for SQL-Server. I've tried using the input command that I found on Sybase's website:
"Input into Tablename from mysqlfile.sql"
Although, it doesn't seem to like "input" (However the command does work perfectly fine in interactive sql).
I'm using the ExecuteNonQuery method in the OdbcCommand (System.Data.Odbc) class.
Thanks in advance,
Eric
|
|
|
|
|
From memory, "Input Into" is a special command that is handled by directly by the ISQL program (and so is not understood by the database engine).
You might consider using running the Sybase BCP command - although you need to be careful of your %PATH environmental variable if you have MS-SQL installed (because the MSSQL client tools has a DLL that clashes). Other possibilities include using MS-SQL's DTS packages.
Hope this helps.
Andy
|
|
|
|
|
Hello,
I am trying to load Excel data to DataSet, (using OldDb... classes). Unfortunately during Fill method of OleDbDataAdapter OLE looses part of my data. I think that is becouse before loading data JET 4.0 makes some assumptions about what type columns in the sheet are. I think, this is why, when in a column there are some numbers and some strings I can read only numbers or only strings - it depends on which is more frequent.
Is there any way I could make OleDBDataAdapter (or JET driver) to read data as string!
Best regards
Leszek
|
|
|
|
|
Hi there. In your connection string, you can use the IMEX import mode - IMEX=1. Something like this:
string sCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\SomeExcelWorksheet.xls;"
+ "Extended Properties=\"Excel 8.0;IMEX=1\"";
You can look at this Microsoft Support document[^] for a more thorough description of the IMEX option.
|
|
|
|