I'd suggest you start by looking at ODBC.
Thursday, 22 March 2012
connect to mysql database with visual c++ in C
Connect to desktop database 2
Please Help me!
I hav emulator Windows CE 4.0 with Visual Studio 2003, C#.
I want connect to sql server 2000......after read all posts of this subject and try all varieties modes of connecting string.....in sql profile i see that application in emulator try to connect the sql server but i have the same exception :
PlatformNotSupportedException
Here my code:
strcon = "Server = developer\\devsql;Initial Catalog = master;User ID = domain\\login; password = ******;Integrated Security = false";
What i did wrong or may be miss something?
I have already solve this problem.....
The problem is nonconformity of collation DB and local settings of the mobile device.....
Tuesday, 20 March 2012
Connect to a SQL Server database file
Hi,
I am a beginner on using SQL Server Express. I have two different questions. Here is the first:
I've developed a simple C# application in Visual Studio 2005 that connects to a SQL Server database file. In the application I connect to the database using this connection string:
@."Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Databases\mydatabas.mdf ;Integrated Security=True;Connect Timeout=30;User Instance=True";
and It works perfect.
But when I move the database file(and the corresponding log-file) to another computer it fails. I've changed the connection string to this
@."Data Source=.\SQLEXPRESS;AttachDbFilename=\\myserver\Databases\mydatabase.mdf ;Integrated Security=True;Connect Timeout=30;User Instance=True";
This is the error message I get when I try to open the database
The file \\myserver\Databases\myDatabase.mdf is on a network path that is not supported for database files.An attempt to attach an auto-named database for file \\myServer\Databases\myDatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Both computer runs Windows XP SP2.
My second question is:
When I deployed my solution to my production PC(witch also runs Windows XP SP2, .NET Framwork 2.0 is installed on the computer) .When I then tried to run the application I did get this error message
An error has occured when establishing a connection to the server. When connection to a SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remomte conections.....
Appearently I cant treat SQL Server database files in the same way as Access-files, or?
Jan Olsson
To use the database on a different machine, SQLExpress would need to be installed on that machine (\\myserver) and the database attached there. Then you would connect to that SQL Server from your local machine. Use the "SQL Server Configuration Manager" to enable network connectivity. The AttachDBFilename really is only intended for local machine use.
SQL Server uses a client/server paradigm and you cannot treat SQL Server database files the same way as Access files.
|||In Access the runtime is in the database files SQL Server is RDBMS(relational database management systems) the runtime is in the server, there is a fixed location for the data files MDF and LDF log data files. They are located in the following location in your c drive, if you intend to use another location you must let SQL Server by code before creating the database. Hope this helps.
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
|||Thanks, for your good answer.
/Jan O.
|||Thanks Peter, I have installed SQL Server Express on my remote computer and attached my database file to SQL Server. it works properly. But how shall I connect to the database from my local machine? I tried to connect from Server Explorer in Visual Studio but it didn't work. I got the message "Login failed for user \\myserver\Guest" and if I want to connect from my C# application how shall the connection string look like.
Jan Olsson
Monday, 19 March 2012
Connect to .mdb Database in Crystal Report 9 from VB
Some one Pls tell me How to connect to a .mdb file from Visual Basic
Am using Crystal Report 9.
I have created a CRAXDRT. Application and Report and I have opened the Report.
How should I pass the database name (.mdb) after this..
I want to add App.Path also when I connect to the database
Thanks
PremodDim CrxRep As New CRAXDDRT.report
Dim CrxApp As New CRAXDDRT.Application
Dim CrxDataFiles As CRAXDDRT.DatabaseTables
strDBPath = "Path to DB Goes Here"
Set CrxRep = CrxApp.OpenReport(App.Path & "\CrystalRpt\BPOilAnalysis.rpt", 1)
Set CrxDataFiles = CrxRep.Database.Tables
CrxDataFiles(1).SetLogOnInfo (strDBPath)
I used this code since my DB path can change and wanted it to remain versatile to the user.
Hope this helps! Tricia =)
Sunday, 11 March 2012
Connect from Visual Basic 6 to SQL Server 2005 express
I downloaded sql server 2005 express and I installed it. I have Visual
Basic 6 application, that work with MS access with ado connection. This
connection give me seek and findfirst methods. I want migrate this access db
to sql sever 2005, but i don't make any change in vb6 code (only the
connection).
My first question is, can i connect from vb6 application to sql sever
2005 express? Moreover,how must i connect the application to sql sever and
work with seek and findfirst methods?
If it's possible, you will put a code example to connect...
Thanks!> Hi people,
> I downloaded sql server 2005 express and I installed it. I have Visual
> Basic 6 application, that work with MS access with ado connection. This
> connection give me seek and findfirst methods. I want migrate this access
db
> to sql sever 2005, but i don't make any change in vb6 code (only the
> connection).
> My first question is, can i connect from vb6 application to sql sever
> 2005 express? Moreover,how must i connect the application to sql sever
and
> work with seek and findfirst methods?
> If it's possible, you will put a code example to connect...
> Thanks!
--
You can't use SEEK and FINDFIRST methods against a SQL Server table. Those
methods will only work against an Access Jet database.
You need to use T-SQL statements such as SELECT...WHERE to accomplish
similar results. Code changes are inevitable.
Hope this helps,
--
Eric Cárdenas
Senior support professional
This posting is provided "AS IS" with no warranties, and confers no rights.
Connect from Visual Basic 6 to SQL Server 2005 express
I downloaded sql server 2005 express and I installed it. I have Visual
Basic 6 application, that work with MS access with ado connection. This
connection give me seek and findfirst methods. I want migrate this access db
to sql sever 2005, but i don't make any change in vb6 code (only the
connection).
My first question is, can i connect from vb6 application to sql sever
2005 express? Moreover,how must i connect the application to sql sever and
work with seek and findfirst methods?
If it's possible, you will put a code example to connect...
Thanks!
> Hi people,
> I downloaded sql server 2005 express and I installed it. I have Visual
> Basic 6 application, that work with MS access with ado connection. This
> connection give me seek and findfirst methods. I want migrate this access
db
> to sql sever 2005, but i don't make any change in vb6 code (only the
> connection).
> My first question is, can i connect from vb6 application to sql sever
> 2005 express? Moreover,how must i connect the application to sql sever
and
> work with seek and findfirst methods?
> If it's possible, you will put a code example to connect...
> Thanks!
You can't use SEEK and FINDFIRST methods against a SQL Server table. Those
methods will only work against an Access Jet database.
You need to use T-SQL statements such as SELECT...WHERE to accomplish
similar results. Code changes are inevitable.
Hope this helps,
Eric Crdenas
Senior support professional
This posting is provided "AS IS" with no warranties, and confers no rights.
Thursday, 8 March 2012
Conncetiviti error
server, and not with all the other files, so it's very strange.
I have a Visual FoxPro cursoradapter who gets populated with a
record from a table in SQL server, and the CursorFill method of
the CursorAdapter (which populates it using the CursorAdapter
properties) raises this error:
Connectivity error: [ODBS SQL Server driver] [SQL Server] Line 1:
incorrect sintax near ")".
The message was in italian so I translated it.
I checked the CursorAdapter's SelList, the SelectCmd, the
KeyFieldList, the Cursorschema... none of them contains
parentheses except the selectcmd, as modified in the
BeforeCursorfill event. The selectcmd is the command that Visual
FoxPro will internally use to call SQL server and populate the
cursoradapter.
This select statement contains the list of fields, the FROM
clause and the following "WHERE" condition:
WHERE FLG_LOAD=0 and (substring(TAG1,1,16) >= ' '
and substring(TAG1,1,16)<=(SELECT
COALESCE(min(substring(TAG1,1,16)),'') FROM AR_ANAGR_ANA_IP WHERE
substring(TAG1,1,16) > ' ' and FLG_LOAD = .F.))
FLO_LOAD and TAG1 are both fields of that table.
Someone sees something strange, in that condition?
TIA
VilliHi
FLG_LOAD = .F.))
The ".F." is not a valid expression in SQL Server. Is it a variable, a value
or ?
Regards
Mike
"Villi Bernaroli" wrote:
> I have this error only when reading a certain file from SQL
> server, and not with all the other files, so it's very strange.
> I have a Visual FoxPro cursoradapter who gets populated with a
> record from a table in SQL server, and the CursorFill method of
> the CursorAdapter (which populates it using the CursorAdapter
> properties) raises this error:
> Connectivity error: [ODBS SQL Server driver] [SQL Server] Line 1:
> incorrect sintax near ")".
> The message was in italian so I translated it.
> I checked the CursorAdapter's SelList, the SelectCmd, the
> KeyFieldList, the Cursorschema... none of them contains
> parentheses except the selectcmd, as modified in the
> BeforeCursorfill event. The selectcmd is the command that Visual
> FoxPro will internally use to call SQL server and populate the
> cursoradapter.
> This select statement contains the list of fields, the FROM
> clause and the following "WHERE" condition:
> WHERE FLG_LOAD=0 and (substring(TAG1,1,16) >= ' '
> and substring(TAG1,1,16)<=(SELECT
> COALESCE(min(substring(TAG1,1,16)),'') FROM AR_ANAGR_ANA_IP WHERE
> substring(TAG1,1,16) > ' ' and FLG_LOAD = .F.))
> FLO_LOAD and TAG1 are both fields of that table.
> Someone sees something strange, in that condition?
> TIA
> Villi
>
>|||Mi e' parso che Mike Epprecht (SQL MVP) abbia scritto:
> Hi
> FLG_LOAD = .F.))
> The ".F." is not a valid expression in SQL Server. Is it
> a variable, a value or ?
Ooooooooooooooops!
Thanks, Mike :)
--
The answer to the ethernal question is:
put a read events after the launch of the form
Saturday, 25 February 2012
Confliction between SQL Server 2005 and SQL Server 2005 Express Edition
Hi,
My objective is using a single DB file (mdf file) + SQL Server Express 2005 to run my program
I got two softwares here, Visual Studio 2005 and SQL Server 2005. Firstly, I installed Visual Studio 2005, normally the SQL Server 2005 Express Edition will be installed with this software. After finishing the installation. I opened a new project and try to open a DB file (.mdf) from Visual Studio 2005, it works. The problem is that I can't restore the mdf file from an old database file since it lose a lot of functions that appear in SQL Server 2000 / SQL Server 2005. And it is too troublesome and inconvenient to edit a DB file in Visual Stuio 2005.
Therefore, I have to install SQL Server 2005 for me to edit the mdf file, so that I can modify, backup, or even restore the mdf file with another DB file. After the installation of SQL Server 2005, I got a tool, SQL Server Managment Studio, to edit the mdf file. I can open the mdf file but when I double-clicked on the mdf file in Visual Studio 2005, it gives me the following error message:
Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL:http://go.microsoft.com/fwlink/?LinkId=49251
It seems the SQL Server 2005 modify some of the files in SQL Server 2005 Express Edition. Is that SQL Server 2005 and SQL Server 2005 Express Edition cannot be exist at the same time?
The issue is I'm working on my computer, but I dun want to install SQL Server 2005 in the server that I will transfer to. It will be much like using Access DB file, without the Microsoft Access software, the program can still work well. However, when I'm still in programming stage, I do hope to have a DB file as the source file for my program, but I can do some editing works with SQL Server 2005.
Does anyone can give me a suggestion? Thanks for your kindly reply.
Calvin
On my machine I have SQL2005 and SQL Express installed at the same time, and both of them work fine. I guess the problem lays in connection string of the database. You can check as following:Go to database explorer-data connections.
Right click your mdf database and click "modify connection"...
Click the advanced button
Search for the "data source" string
Set the string to refer to your SQL Server2005 instance.
You can take a look at this link:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=124596&SiteId=1.
BTW, if you just want to operate on the database file more directly, you do not need to install SQL Server2005. You can intall "SQL Server Management Studio Express " from here:
http://msdn.microsoft.com/vstudio/express/sql/download/
.Friday, 17 February 2012
Configuring SQL Express -- getting login failed exception
I have a machine with Windows XP Pro w/SP 2, IIS, SQL Server Express and Visual Studio 2005 installed. When I attempt to open a database from an ASPX page, I'm getting an exception with the message:
"Cannot open database "Tasks" requested by the login. The login failed.
Login failed for user 'MYDEV\ASPNET'."
I've searched the web and found a number of pages that talk about the "Login failed for MACHINE\ASPNET" issue, but I didn't find any with a solution.
For your information (in case it makes any difference), the computer is connected to a domain. And the authentication methods for the virtual directory (in IIS) is configured for "Anonymous access" and "Integrated Windows authentication."
Does anyone know how to configure SQL Server Express (or is it IIS?) so the web page can access the database?
RichardR
Okay, I found a solution.
For anyone else experiencing this problem, here's what I did:
First, I installed the November CTP of SQL Server Management Studio Express.
Then, I added the account MACHINENAME\ASPNET under Security | Logins. I did a right-mouse click on the ASPNET login name and clicked on Properties.
This brought up the Login Properties page for ASPNET. I mapped the ASPNET account to my database selecting the database in the "Default Database" dropdown.
In order for the stored procedures to execute, I also needed to check the db_owner box under the Mappings tab.
Finally, I needed to change the connection string to:
Data Source=MYDEV\SQLEXPRESS;Connect Timeout=30;User Instance=False;initial catalog=Tasks;Integrated Security=SSPI;Persist Security Info=False
Hope this helps anyone else encountering this problem.
Richard
|||Thanks - that was very helpful!!!|||Thanks for the post! Saved my life after hours of searching!!!
Configuring SQL Express -- getting login failed exception
I have a machine with Windows XP Pro w/SP 2, IIS, SQL Server Express and Visual Studio 2005 installed. When I attempt to open a database from an ASPX page, I'm getting an exception with the message:
"Cannot open database "Tasks" requested by the login. The login failed.
Login failed for user 'MYDEV\ASPNET'."
I've searched the web and found a number of pages that talk about the "Login failed for MACHINE\ASPNET" issue, but I didn't find any with a solution.
For your information (in case it makes any difference), the computer is connected to a domain. And the authentication methods for the virtual directory (in IIS) is configured for "Anonymous access" and "Integrated Windows authentication."
Does anyone know how to configure SQL Server Express (or is it IIS?) so the web page can access the database?
RichardR
Okay, I found a solution.
For anyone else experiencing this problem, here's what I did:
First, I installed the November CTP of SQL Server Management Studio Express.
Then, I added the account MACHINENAME\ASPNET under Security | Logins. I did a right-mouse click on the ASPNET login name and clicked on Properties.
This brought up the Login Properties page for ASPNET. I mapped the ASPNET account to my database selecting the database in the "Default Database" dropdown.
In order for the stored procedures to execute, I also needed to check the db_owner box under the Mappings tab.
Finally, I needed to change the connection string to:
Data Source=MYDEV\SQLEXPRESS;Connect Timeout=30;User Instance=False;initial catalog=Tasks;Integrated Security=SSPI;Persist Security Info=False
Hope this helps anyone else encountering this problem.
Richard
|||Thanks - that was very helpful!!!|||Thanks for the post! Saved my life after hours of searching!!!
Configuring SQL Express -- getting login failed exception
I have a machine with Windows XP Pro w/SP 2, IIS, SQL Server Express and Visual Studio 2005 installed. When I attempt to open a database from an ASPX page, I'm getting an exception with the message:
"Cannot open database "Tasks" requested by the login. The login failed.
Login failed for user 'MYDEV\ASPNET'."
I've searched the web and found a number of pages that talk about the "Login failed for MACHINE\ASPNET" issue, but I didn't find any with a solution.
For your information (in case it makes any difference), the computer is connected to a domain. And the authentication methods for the virtual directory (in IIS) is configured for "Anonymous access" and "Integrated Windows authentication."
Does anyone know how to configure SQL Server Express (or is it IIS?) so the web page can access the database?
RichardR
Okay, I found a solution.
For anyone else experiencing this problem, here's what I did:
First, I installed the November CTP of SQL Server Management Studio Express.
Then, I added the account MACHINENAME\ASPNET under Security | Logins. I did a right-mouse click on the ASPNET login name and clicked on Properties.
This brought up the Login Properties page for ASPNET. I mapped the ASPNET account to my database selecting the database in the "Default Database" dropdown.
In order for the stored procedures to execute, I also needed to check the db_owner box under the Mappings tab.
Finally, I needed to change the connection string to:
Data Source=MYDEV\SQLEXPRESS;Connect Timeout=30;User Instance=False;initial catalog=Tasks;Integrated Security=SSPI;Persist Security Info=False
Hope this helps anyone else encountering this problem.
Richard
|||Thanks - that was very helpful!!!|||Thanks for the post! Saved my life after hours of searching!!!Friday, 10 February 2012
Configure the version of referenced Assemblies after the deployment
I'm using the Reporting Services 2000 and the Report Designer within Visual Studio 2003. I have
configured several Assembly References (Report Properties -> References). After the addition of an
Assembly the respective row shows amongst others the version of the referenced Assembly. These
informations can be found in the RDL file as well.
I'm looking for a way to configure the version of a referenced Assembly "at runtime" *after* the
deployment of the respective report to the Reporting Services. From .NET Assemblies I know the
application configuration files (.config file) which can be used to configure and to change,
respectively, the version of referenced Assemblies "at runtime".
Thanks in advance,
Jochen.Hello Jochen,
You could redirect one version of myAssembly to another in the web.config
file of the ReportServer folder.
For more information, you could refer the following article:
http://msdn2.microsoft.com/en-us/library/7wd6ex19(VS.80).aspx
Hope this will be helpful!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Hello Wei,
thank you very much. This is exactly what I'm looking for.
Regards,
Jochen.
Wei Lu [MSFT] wrote:
> Hello Jochen,
> You could redirect one version of myAssembly to another in the web.config
> file of the ReportServer folder.
> For more information, you could refer the following article:
> http://msdn2.microsoft.com/en-us/library/7wd6ex19(VS.80).aspx
> Hope this will be helpful!
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>