Showing posts with label guys. Show all posts
Showing posts with label guys. Show all posts

Tuesday, March 20, 2012

Accessing a Microsoft Access database from within Visual C++

Hi there guys, I am currently trying to achieve a seemingly simple task in VC++ 2005. I have made a very simple form in Microsoft Access which I wish to serve as the beginnings of something greater. I created a db in MS Access named links.mdb containing on table-> Table1. Table1 contains 1 column, "Links", and i wish to read these strings into variables in my Visual C++ Windows Forms Application.

What I have done so far...

In Visual C++, I clicked on Data->Add new data source, and followed the wizard to add the microsoft access database to my application by the name, "linksDataSet". I can see the table in my left hand "Data Sources" pane in VC++. All I need to know is how to access my database from here so that I can read these strings stored in my table. Also, would be possible to schedule my application to log on to a http server and retrieve these links every time the application is executed? How would I go about doing this?

Thank you very much for your time
Regards
Linden.Umm... hi, my topic has been moved into this forum, even though I don't think it belongs here because my question is VC++ database related but can anyone help me? I would greatly appreciate it.|||44 Views and not one reply? Is this not a familiar concept?|||This is ridiculous! Why is this forum here? It obviously serves no purpose.|||

To read a Microsoft Access database table from VC++ 2005:

1. First I created a new Windows Console project in VC++.

2. Then Project | Add Class... then go under ATL and choose ATL OLEDB Consumer.

3. Click Data Source and choose Microsoft Jet 4.0 OLEDB Provider, Next>>> then type in database name.

4. Click OK, another dialog comes up, choose your table, it will create a single class for your table.

Then the code to read the data is like so:

#include "stdafx.h"

#include "Table1.h"

int _tmain(int argc, _TCHAR* argv[])

{

CoInitialize(NULL); // Be sure to initialize COM somewhere in your app one time...

CTable1 table1;

HRESULT hr = table1.OpenAll();

for(;;)

{

hr = table1.MoveNext();

if (S_OK != hr) break;

printf("table1.f1=%lu\n", table1.m_f1);

printf("table1.f2=%S\n", table1.m_f2);

}

return 0;

}

|||I am currently working in a windows forms application, how would the code change?

Thursday, March 8, 2012

access to sql server

hello guys,
i am moving from using access database to use SQL server...i ve never used it before! is there anything difficult in using it?
and do i have only to change the connection string?
actuelly i dont know even how to upload the sql server database to the hostmare there any setting has to be done?...is it one file ? or more? where can i find it if i am using sqlserver evaluation ? and can the connection string point directly to the physical path of the database -in case it is one file and if it is possible-
one more thnik please...does sql server have reporting services (like crystal reports) so i can export the data to a pdf or excel?
and the last...is is there anyway for just simply convert a dataset to pdf...
iknow it is a lot of questions...but i feel moving to sql server is very hard...and i hope it is not!
thanks in advancedHere are some opinions:

msadekd wrote:


i am moving from using access database to use SQL server...i ve never used it before! is there anything difficult in using it?
and do i have only to change the connection string?


The answer is: it depends. :-) If you stuck with ANSI syntax thereshouldn't be too much you have to change as far as the physcialqueries, etc. are concerned. But on the ADO.NET end, you willlikely want to use SqlClient instead of OleDb to talk to your databaseas SqlClient is fine-tuned for SQL Server.

msadekd wrote:


actuelly i dont know even how to upload the sql server database to thehostmare there any setting has to be done?...is it one file ? ormore? where can i find it if i am using sqlserver evaluation ? andcan the connection string point directly to the physical path of thedatabase -in case it is one file and if it is possible-


On way is to use SQL Enterprise Manager to transfer your databaseobjects from your local server to the host's server. See my posthere on how to copy your database objects to your host:http://forums.asp.net/1036946/ShowPost.aspx.


one more thnik please...does sql server have reporting services(like crystal reports) so i can export the data to a pdf or excel?


There is something calledSQL Server Reporting Services, and this integrates with Visual Studio .NET.


and the last...is is there anyway for just simply convert a dataset to pdf...


I don't know the answer to this question; I haven't played with that myself.

Access to SQL Express connection string

I need to hardcode my TCP port to a SQL Server Express named instance. You guys have any examples I could see. I keep getting an error when I try to connect:

Run-time error 2147467259 BBNETLIB connection open parse connection paramaters, invalid connection. I'm trying to connect to a local instance on a Windows 2003 server.

Please post your connection string.|||

CONNECTION=Provider=SQLOLEDB;Data Source=SQCTLxp1\C1SQLEXPRESS;User ID=sa;Password=!!Gulpp1!!;Initial Catalog=@.DBNAME;

I removed the semicolon at the end of the connection string and it worked. Thank You.

Access to SQL Express connection string

I need to hardcode my TCP port to a SQL Server Express named instance. You guys have any examples I could see. I keep getting an error when I try to connect:

Run-time error 2147467259 BBNETLIB connection open parse connection paramaters, invalid connection. I'm trying to connect to a local instance on a Windows 2003 server.

Please post your connection string.|||

CONNECTION=Provider=SQLOLEDB;Data Source=SQCTLxp1\C1SQLEXPRESS;User ID=sa;Password=!!Gulpp1!!;Initial Catalog=@.DBNAME;

I removed the semicolon at the end of the connection string and it worked. Thank You.

Tuesday, March 6, 2012

Access to integration services

Hi Guys,

I have a quick question, Can i access the SSIS services of a Server from a remote server using Sql Server management studio.

I'm trying to access a third DB server and i can access it using Sql server management studio with sa and password but the integration services aren't there and when i try to explicitly connect to it, it is not connecting

Any ideas?

P.S: Can any of you recommend a very good book as I've done some work with it but it seems i might be the one doing more work with BI from now on as the organisation is not going to appoint anyone else in this position.

Thank you

Gemma

Do you have the SSIS service running on the server? Do you get any error messages?|||

Gemma wrote:

P.S: Can any of you recommend a very good book as I've done some work with it but it seems i might be the one doing more work with BI from now on as the organisation is not going to appoint anyone else in this position.

This is a good book. Especially for doing ETL with SSIS.

http://www.amazon.com/Expert-Server-Integration-Services-Programmer/dp/0470134119/
|||

If you want something that is more of a reference, the Kirk Haselden Microsoft SQL Server 2005 Integration Services is really good. The Wrox Programmer to Programmer SQL Server 2005 Integration Services is also decent. (They cover nearly the same topics, you will only need one or the other)

I'd agree that Expert SSIS is a good book (through about half of it now). The Expert SSIS is more of a walk through while explaining some of the theories and providing tips and best practices. It often tells the reader to refer to the SQL Server 2005 Integration Services book for more detailed information on the various tasks / transforms.

If you are looking for a reference on Datawarehousing / B.I. in relation to SQL 2005 SSIS / Analysis Services / Reporting etc, The Microsoft Data Warehouse Toolkit by Joy Mundy and Warren Thornthwaite is pretty good. If you are just looking for Datawarehousing / B.I. theory then you should probably read The Data Warehouse Toolkit Second Edition by Ralph Kimball.

I also have the Delivering Business Intelligence with Microsoft SQL Server 2005 (Larson) and Practical Business Intelligence with SQL Server 2005 (Hancock) but have not had a chance to read through them as of yet....

|||

Gemma wrote:

Hi Guys,

I have a quick question, Can i access the SSIS services of a Server from a remote server using Sql Server management studio.

I'm trying to access a third DB server and i can access it using Sql server management studio with sa and password but the integration services aren't there and when i try to explicitly connect to it, it is not connecting

Any ideas?

We were having this problem until earlier this week (we are in the beginning phases of using SSIS ourselves). We were able to resolve the access denied issue (if that is what you are having) by following the steps in the following article: http://sqljunkies.com/WebLog/knight_reign/archive/2006/01/05/17769.aspx

|||

Thanks to all of you, who contributed. I have made a note of your suggested books.

Can any of you also tell me a very good t-sql book as I'm really really bad in t-sql?

Thanks again

Gemma

|||

You'll want two: Inside SQL Server 2005: T-SQL Programming and T-SQL Querying. You will need to read the Querying before the programming as the programming book builds off of ideas presented in the first book.

(Although I only bought them a little less than a month ago and haven't read them yet, when I did research those were the two that came with the highest recommandations)

|||

Thank you


Ta

Gemma

Sunday, February 19, 2012

Access Not Executing Stored Procedure correctly

Hi guys I cant seem to get my stored procedure to execute properly through Access Xp. Do you think there is something wrong with my stored procedure??

CREATE PROCEDURE [insert_ConditionalLicense_UpdateFromTerms]
(@.TM_# [int],
@.FirstName [nvarchar](50),
@.LastName [nvarchar](50),
@.SS# [nvarchar](50),
@.Birthdate [nvarchar](50),
@.reasonforconditional [ntext],
@.Notes [ntext])

AS INSERT INTO [GamingCommissiondb].[dbo].[ConditionalLicense_View]
( [TM #],
[FirstName],
[LastName],
[SS#],
[reasonforconditional],
[ConditionalStart Date])


SELECT
[TM#],
[LASTNAME],
[FIRSTNAME],
[SSN#],
[NOTES],
[DATEOFCONDITIONAL]

FROM EmployeeGamingLicense
WHERE STATUS = 'TERMINATION-COND'
IF @.@.Error <> '0'
RETURN

when I execute it through a command button this is the message I get "paramater" not quite sure why I am getting this messageYou have to provide the parameters on the call you are making with the "on click" action. Otherwise, it will prompt you for them.

?|||Well I have the same kind of stored procedure on another form and it doesnt do that. I have a stored procedure on the Termination form that executes once the users press the command button. Hmm??|||No. There has to be some difference between the two. Look at them closely to find it.|||Ok I will take a closer look at my stored procedure. I'll try again thanks guys|||Ok I will take a closer look at my stored procedure. I'll try again thanks guys