Community
Showing results for 
Search instead for 
Do you mean 
Reply

Table Names

Accepted Solution Solved
Copper Contributor
Posts: 61
Country: United_Kingdom
Accepted Solution

Table Names

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


Accepted Solutions
Solution
Accepted by topic author hysezer
‎09-25-2015 03:20 AM
Copper Contributor
Posts: 61
Country: United_Kingdom

Re: Table Names

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 ?

View solution in original post


All Replies
Employee
Posts: 1,163
Country: USA

Re: Table Names

Looks like it's just a syntax issue with the select statement. 

 

Change TBL_OPPORTUNITY to just 'Opportunity' and the query should execute.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 61
Country: United_Kingdom

Re: Table Names

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

 

er1.jpg

 

something about remote connection

 

and when I try other one which is from actreader login I'm getting this error

 

er2.jpg

 

 

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

Employee
Posts: 1,163
Country: USA

Re: Table Names

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?

Matthew Wood
Act! SDK Support
Community Moderator
Solution
Accepted by topic author hysezer
‎09-25-2015 03:20 AM
Copper Contributor
Posts: 61
Country: United_Kingdom

Re: Table Names

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 ?

Employee
Posts: 1,163
Country: USA

Re: Table Names

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);

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 61
Country: United_Kingdom

Re: Table Names

Yes Matthew that was the problem I logged in now thanks again for your help!