Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Monday, March 26, 2012

odbc connections

A colleague of mine has a problem;
"Has anyone ever experienced the problem of creating a System ODBC and it doesn't display in the ODBC administrator applet?"
was hoping someone here could help...What is your exact problem?|||the problem was that when created a new odbc connection this was not displayed...i have since discovered a reboot fixed it-i was under the impression that the sql server would have been rebooted first...dont worry about it!
thanks though

Monday, March 19, 2012

odbc communication link failure

Hello,

I have a problem in ODBC that when I open a call logging program, it display "08S01 communication link failure. However, the connection between the driver and data source (in Sydney) is ping ok and data source test successful.

My PC os : window xp professional sp2

ODBC drvier version : 2000.85.1117.00

Can anyone help me to solve the problem ?

Thanks

Rex Leung

Rex,

Could share out the exact error message from your odbc driver when connect fails? Also, is your server name instance and default instance. Is it listened on TCP or NP. can you connect to the server from the same machine. What exactly the connection string you were using for the local odbc connection?

Thanks,

ODBC command

hi,

I have a search function.

I was able to display attributes of a record in one table, but

I also need to get one attribute from another table.

My question is how can I implement inner join in this kind of query in odbc command?

this is a part of my code:

1'||||| Create Command Object2Dim odbcCommand_searchAs OdbcCommand =New OdbcCommand("Select TM0001.syain_id, TM0001.syain_name, TM0001.syain_pass, TM0001.empl_date, TM0001.birth_date, TM0011.office_name from TM0001,TM0011 where TM0001.syain_id = ? or TM0001.syain_name = ? and TM0011.office_id = TM0001.office_id ", MyConn)34'||||| Parameters and set values.5 odbcCommand_search.Parameters.Add("@.P1", OdbcType.Char).Value = TextBox_id_name.Text'emp_id.ToString6 odbcCommand_search.Parameters.Add("@.P1", OdbcType.Char).Value = TextBox_id_name.Text'emp_name.ToString789Dim objReaderAs Odbc.OdbcDataReader10 objReader = odbcCommand_search.ExecuteReader()11While objReader.Read()1213 TextBox_id.Text = objReader("syain_id")14 TextBox_name.Text = objReader("syain_name")15 TextBox_pswd.Text = objReader("syain_pass")16 DropDownList_office.Text = objReader("office_name")17 hire_date = objReader("empl_date")181920End While2122 objReader.Close()2324


All values can be displayed except for the "office_name" which is from another Table "TM0011".

hope you can help me with this.

thanks

sheila

You want something like

...from TM0001INNER JOIN TM0011ON TM0011.office_id = TM0001.office_id where TM0001.syain_id = ? or TM0001.syain_name = ?

That is the gist. Just make sure you are joining the matching fields that you are looking for.

|||

You can also try this:

Select TM0001.syain_id, TM0001.syain_name, TM0001.syain_pass, TM0001.empl_date, TM0001.birth_date, (SELECT TM0011.office_name FROM TM0011 WHERE TM0011.office_id = TM0001.office_id) FROM TM0001 WHERE TM0001.syain_id = ? OR TM0001.syain_name = ?