Jump to content

HELP on .NET and FM8


HTKyle
 Share

This topic is 5367 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

i want to use asp .net to fm8 via odbc... but returns very odd errors... can someone post a link or a sample code on how to do this... a very simple example would be very much appreciated...tnx

Link to comment
Share on other sites

What kind of errors?

Also check out www.fmDotNet.org. fmDotNet returns a standard DataSet for you to use. It does not use ODBC but FileMaker's XML publishing.

For a quick example check out http://db-commerce.com/fmDotNet/F1.aspx

(note: hosted from a server in my office with very limited bandwidth, so speed is not great).

I can send you the source code for that example if you want.

Link to comment
Share on other sites

  • 1 month later...

I'm on the road right now and I'm not sure I have a copy of the source code on my laptop. If I do I'll post it here...

In the meantime, if you want to see how fmDotNet works, download the sample application I have up at www.fmDotNet.org. It's for a desktop app, not a website but the code is pretty much the same.

Link to comment
Share on other sites

  • 2 weeks later...
  • Newbies

Wim,

I'd still like to see the web page example, if you get the time to post it.

I taught myself ASP/VB using working pages as templates. I was hoping to use your page as a starting point for my journey into the world of .NET.

Also, when will we get to see an article about fmdotnet in FM Advisor?

Thanks much,

George

Link to comment
Share on other sites

  • 6 months later...

Hi,

This looked like a useful post as I am also trying to connect FM8 remotely through my website. I am using C#. I have downloaded fmDotNet sample application but could not make much sense out of it. Can you please post the other sample (F1.aspx) again? I just need a code snippet that I can use as an example that shows how to create an object and insert values in a table in FM, so pasting that in a post will also do. Any help will be greatly appreciated.

Thanks,

Max

Edited by Guest
Link to comment
Share on other sites

Hi Max,

What part of the sample C# application doesn't make sense? That app has more to offer than the F1 one so it would make more sense to talk you through the sample app than give you a new sample.

The F1 sample does no updating of FM files while the sample app does for instance...

Link to comment
Share on other sites

Hi Wim,

Thank you for your response. I am trying to connect to FM8 and insert a record but the problem is that I don't know which drivers or providers to use and what should be the sequence of statements. I am using the following to accomplish this:

ADODB.Connection conn = new ADODB.Connection();

try

{

conn.Mode = ADODB.ConnectModeEnum.adModeReadWrite;

conn.Open(, , , -1);

string editQuery = "INSERT INTO

conn.Execute(editQuery);

}

catch (System.Exception ex)

{

txtOrgName.Text = ex.ToString();

}

finally

{

conn.Close();

}

I am getting "Parse Error in SQL" from this code.

This is what I get:

System.Runtime.InteropServices.COMException: [DataDirect][ODBC SequeLink driver][ODBC Socket][DataDirect][ODBC FileMaker driver][FileMaker]Parse Error in SQL

I know this works because it is already working in an ASP page.

P.S. I am sorry if I offended you in any way by writing that your application doesn't make any sense to me but I went through the code line by line to find where the connection is made and how data is accessed but could not find it. The application is written nicely but I could not find what I wanted.

Please help,

Max

Edited by Guest
Link to comment
Share on other sites

Thank you all for trying. I got it. I just had to insert double quotes for the table name and for all the field names. I did that by using char c = (char)34; in C# as I am prgramming in c#. This small thing ate my day. :D

Link to comment
Share on other sites

You didn't offend me, don't worry :)

But now it makes more sense: you're using ODBC. fmDotNet does not. fmDotNet uses FileMaker Server's XML interface with fmDotNet being an abtraction layer for .NET programmers so they wouldn't have to worry about making the correct url syntax into FMSA or working with the XML that FMSA returns (fmDotNet returns a DataSete).

A connection to FMSA is made like this:

fms = new FMSAxml(chosenScheme, theServer, thePort, theAccount, thePW);

And a typical query would look like:

fms.SetLayout(this.cmbLayouts.Text);

FMSAxml.FindRequest query = new FMSAxml.FindRequest(queryType, fms);

query.AddSearchField(this.cmbField.Text, this.txtValue.Text, so);

ds = query.Execute();

(where ds is a DataSet variable)

Link to comment
Share on other sites

Thank you for the update. I will keep this in mind as I have read that ODBC is very slow and using XML is much faster.

Right now my web application has only one insert query but probably in future I may need to write more complex queries where I can use fmDotNet.

Do you by any chance know whether exporting to PDF from FMP's IWP is possible or not. I did not receive positive responses for this anywhere but am still hopeful. :)

Link to comment
Share on other sites

This topic is 5367 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.