07-20-2012 08:14 AM
Hello everyone,
I'm trying to send a sql querry to my ACT but when I use table name which I have taken from my other code doesn't work. In my other code I can use TBL_OPPORTUNITY.CUST_RoomType
but when I try to use TBL_OPPORTUNITY in my sql statement like
cmd = New OleDb.OleDbCommand("SELECT * from TBL_OPPORTUNITY ", con)
I get
Invalid table name.
Dictionary::AddTableNode failed (error=80004005)
error
any ideas?
Thanks
07-24-2012 05:35 AM
Yes Matthew I tried replacing it and there is no selected database it's the same error with the first connection string I tried. ACT version is 14 and I can open the database from my SQL server management studio with windows authentication.
I've just seen something my server name on sql manager is USER-PC1\ACT7 and in connection string its REDDEV\ACT7, do you think the error is because of this ?
07-23-2012 06:10 AM
Looks like it's just a syntax issue with the select statement.
Change TBL_OPPORTUNITY to just 'Opportunity' and the query should execute.
07-24-2012 03:46 AM
Hello Matthew,
Thanks for your reply I think my problem isn't exactly table name since I figured out that my connection with database isn't working I've tried the solutions which were posted on this topic http://community.act.com/t5/Sage-ACT-Developer-s-Forum/OLEDB-Connection-String/m-p/72617/highlight/t... but I still got errors
when I try to make a data source connection I'm getting this error
something about remote connection
and when I try other one which is from actreader login I'm getting this error
and here is my code,
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim con As OleDb.OleDbConnection
con = New OleDb.OleDbConnection("Provider=SQLOLEDB;Data Source=REDDEV\ACT7;Password=xxxx;User ID=actreader;Initial Catalog=YASIN_TC")
con.Open()
Dim cmd As OleDb.OleDbCommand
cmd = New OleDb.OleDbCommand("Select * from Opportunity", con)
Dim i As Integer
i = cmd.ExecuteNonQuery()
MessageBox.Show(i)
End Sub
Is there any work around these errors.
Thanks in advance
07-24-2012 05:25 AM
Ok, since you've already taken a look at that thread I'm going to assume you've tried replacing your connection string with 'ActFramework.ACTOLEDB2', or that your not logged onto the framework.
What version of Act was this? Version 14 was the first to allow window authentication to SQL, however this doesn't appear to be a logon issue.
Are you able to open the database on this machine without a problem?
07-24-2012 05:35 AM
Yes Matthew I tried replacing it and there is no selected database it's the same error with the first connection string I tried. ACT version is 14 and I can open the database from my SQL server management studio with windows authentication.
I've just seen something my server name on sql manager is USER-PC1\ACT7 and in connection string its REDDEV\ACT7, do you think the error is because of this ?
07-24-2012 05:53 AM
Sure, espeically since the error is cannot find server or establish a connection.
Is it saying no database is selected because you've not logged onto the framework in your application?
ActFramework afw = new ActFramework();
afw.LogOn(UserName, PW, PadFileLocation);
07-24-2012 06:25 AM
Yes Matthew that was the problem I logged in now thanks again for your help!